Re: [PATCH v2] kasan: fix cache shrink race with CPU hotplug

Andrew Morton <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.stable,org.kvack.linux-mm
Message-ID <[email protected]>
On Sat,  8 Aug 2026 17:38:05 +0800 Hui Su <[email protected]> wrote:

> Thanks Andrew,
> 
> On Sat, Aug 08, 2026 at 12:39:21AM -0700, Andrew Morton wrote:
> > AI review suggests that there's a pre-existing quarantine_size
> > accounting flaw later in this function:
> >
> > 	https://sashiko.dev/#/patchset/[email protected]
> >
> > If true, I'm surprised this hasn't yet been reported.
> 
> I'll take a closer look at this. If it turns out to be a real issue,
> I'll send a separate patch since it's pre-existing and unrelated to the
> hotplug race fix.
> 
> > Also, I'd like to see a need_resched() wrapping that expensive
> >
> > 		/* Scanning whole quarantine can take a while. */
> > 		raw_spin_unlock_irqrestore(&quarantine_lock, flags);
> > 		cond_resched();
> > 		raw_spin_lock_irqsave(&quarantine_lock, flags);
> 
> Good point, that makes sense. Would you prefer that I fold this into a
> v3 of this patch, or send it as a separate follow-up patch?

Separate patches, please.  One patch per concept.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.