Re: [PATCH] mm: skip dirty file folios during isolation of legacy LRU
From: Kairui Song
Date: Mon Mar 23 2026 - 06:11:42 EST
On Mon, Mar 23, 2026 at 5:17 PM Zhaoyang Huang <huangzhaoyang@xxxxxxxxx> wrote:
>
> On Fri, Mar 20, 2026 at 5:20 PM Kairui Song <ryncsn@xxxxxxxxx> wrote:
> >
> > On Fri, Mar 20, 2026 at 4:34 PM zhaoyang.huang
> > <zhaoyang.huang@xxxxxxxxxx> wrote:
> > >
> > > From: Zhaoyang Huang <zhaoyang.huang@xxxxxxxxxx>
> >
> > Hi Zhaoyang,
> >
> > > Since dirty file folios are no longer writeout in reclaiming after
> > > 'commit 84798514db50 ("mm: Remove swap_writepage() and
> > > shmem_writepage()")', there is no need to isolate them which could help
> > > to improve the scan efficiency and decrease the unnecessary TLB flush.
> >
> > But you are still isolating them with this patch, you just adjusted
> > where the statistical update happens.
> sorry, I missed the above information in previous feedback. No. The
Hi Zhaoyang
No worries, feel free to discuss anytime.
> dirty file folios are moved back to lruvec instead of being isolated
> under this patch. How about apply this only when isolate_lru_folios is
> called from shrink_active_list which has no worries about stuck the
> inactive list.
Hmm, No? Reading your code in isolate_lru_folios, you do "goto move"
when "folio_trylock" fails. But for "if (dirty || writeback)" folios,
you only do "nr_dirty += nr_pages;". Am I missing anything?
And as for the different behavior for active / inacitve isolation, I
don't know if that's a valid optimization worth the complicity, and
the worse part is it may break the dirty flush wake up logic, as
shrinker may never see any dirty writeback folios now.