Re: [PATCH] mm: add maybe_lru_add_drain() that only drains when threshold is exceeded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 18, 2024 at 10:13:30PM -0500, Rik van Riel wrote:
> On Wed, 2024-12-18 at 12:20 -0800, Shakeel Butt wrote:
> > On Wed, Dec 18, 2024 at 11:56:04AM -0500, Rik van Riel wrote:
> > [...]
> > >  
> > > +static bool should_lru_add_drain(void)
> > > +{
> > > +	struct cpu_fbatches *fbatches =
> > > this_cpu_ptr(&cpu_fbatches);
> > 
> > You will need either a local_lock or preempt_disable to access the
> > per
> > cpu batches.
> > 
> Why is that? Can the per-cpu batches disappear on us
> while we're trying to access them, without that
> local_lock or preempt_disable?
> 
> I'm not trying to protect against accidentally reading
> the wrong CPU's numbers, since we could be preempted
> and migrated to another CPU immediately after returning
> from should_lru_add_drain, but do want to keep things
> safe against other potential issues.
> 

I was thinking of task migration across CPUs but it can still happen
while zap is ongoing. Yeah we might need to reevaluate if we really need
to drain here or do draining periodically.





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux