Re: [PATCH] mm: move folio LRU helpers out of swap
From: Jianyue Wu
Date: Tue Apr 07 2026 - 08:36:52 EST
On 4/7/2026 7:42 PM, David Hildenbrand (Arm) wrote:
>
> A note that shmem also uses swap.
>
Hi David,
Thanks for the hint. I agree shmem participates in the same
anonymous/swap-side paths. I'll fix the commit message in the next
revision to say that clearly.
Best regards,
Jianyue Wu
On 4/7/2026 7:20 PM, Michal Hocko wrote:
>
> All that big churn is really worth it? Are there any other reasons than
> "not so appropriate"?
>
> Really if this is not a part of a much bigger plan then NAK.
Hi Michal,
The intent here is to keep generic LRU/reclaim helpers separate from
swap-specific code paths.
The LRU helpers are shared by both file and anonymous memory, whereas
swap.c is meant to host logic tied to swap devices and swap entries.
Placing LRU code there would blur the boundary between general reclaim
and swap, and make the code harder to follow.
Separately, I’ve been looking at routing zram’s swap-slot handling
through swap-owned hooks (e.g., swap_ops / swapon probing), which
would involve swapfile.c and swap.h. That’s likely orthogonal to this
LRU move, but it’s driven by the same goal of clarifying the swap
boundary.
Best regards,
Jianyue Wu