Re: [patch 113/131] mm: balance LRU lists based on relative thrashing

From: Joonsoo Kim
Date: Wed Jun 10 2020 - 01:24:16 EST


2020ë 6ì 9ì (í) ìí 11:46, Johannes Weiner <hannes@xxxxxxxxxxx>ëì ìì:
>
> On Tue, Jun 09, 2020 at 05:15:33PM +0800, Alex Shi wrote:
> >
> >
> > å 2020/6/4 äå7:03, Andrew Morton åé:
> > >
> > > + /* XXX: Move to lru_cache_add() when it supports new vs putback */
> >
> > Hi Hannes,
> >
> > Sorry for a bit lost, would you like to explain a bit more of your idea here?
> >
> > > + spin_lock_irq(&page_pgdat(page)->lru_lock);
> > > + lru_note_cost(page);
> > > + spin_unlock_irq(&page_pgdat(page)->lru_lock);
> > > +
> >
> >
> > What could we see here w/o the lru_lock?
>
> It'll just be part of the existing LRU locking in
> pagevec_lru_move_fn(), when the new pages are added to the LRU in
> batch. See this older patch for example:
>
> https://lore.kernel.org/linux-mm/20160606194836.3624-6-hannes@xxxxxxxxxxx/
>
> I didn't include it in this series to reduce conflict with Joonsoo's
> WIP series that also operates in this area and does something similar:

Thanks!

> https://lkml.org/lkml/2020/4/3/63

I haven't completed the rebase of my series but I guess that referenced patch
"https://lkml.org/lkml/2020/4/3/63"; would be removed in the next version.

Before the I/O cost model, a new anonymous page contributes to the LRU reclaim
balance. But, now, a new anonymous page doesn't contributes to the I/O cost
so this adjusting patch would not be needed anymore.

If anyone wants to change this part,
"/* XXX: Move to lru_cache_add() when it supports new vs putback */", feel free
to do it.

Thanks.