Re: [PATCH] mm: move folio LRU helpers out of swap
From: Jianyue Wu
Date: Tue Apr 07 2026 - 20:41:50 EST
On 4/7/2026 10:22 PM, Johannes Weiner wrote:
> Ironically, the only thing that doesn't fit in this file is the swap
> stuff. The page_cluster & sysctl should be static in swap_state.c.
>
> The rest seems thematically relatively clean - infrastructure for
> managing folio lifetime. swap.c is not the best name for it, but short
> of finding a very clear improvement I'd just leave it alone.
Thanks everyone for the reviews and the clear feedback.
I’m withdrawing this patch. I understand the concerns about the
relative include path, the limited benefit versus churn/conflicts.
I learned a lot from the discussion, many details in mm parts.
Thanks again for your time.
Best regards,
Jianyue Wu
On Tue, Apr 7, 2026 at 10:22 PM Johannes Weiner <hannes@xxxxxxxxxxx> wrote:
>
> On Tue, Apr 07, 2026 at 07:00:02PM +0800, Jianyue Wu wrote:
> > All allocated folios are added into lru lists for later reclaim whether
> > they are file or anonymous folios. However those folio lru operation codes
> > are put in mm/swap.c which is not so appropriate. Because swap code is
> > only for anonymous folios.
>
> Ironically, the only thing that doesn't fit in this file is the swap
> stuff. The page_cluster & sysctl should be static in swap_state.c.
>
> The rest seems thematically relatively clean - infrastructure for
> managing folio lifetime. swap.c is not the best name for it, but short
> of finding a very clear improvement I'd just leave it alone.