Re: [PATCH v3 2/3] mm: move folio LRU code out of swap

From: Matthew Wilcox

Date: Tue Jun 02 2026 - 11:58:18 EST


On Tue, Jun 02, 2026 at 09:01:16AM +0800, Jianyue Wu wrote:
> Rename mm/swap.c to mm/folio_lru.c so the filename better matches
> the code's main responsibility.
>
> This keeps the implementation split from swap-specific code without
> changing the published LRU helper interfaces.

At the same time, we have Tal trying to split folio_wait.c out
of filemap.c. https://lore.kernel.org/linux-mm/20260520-filemap-split-v1-0-c36ddc2b6cf2@xxxxxxxxxxxx/

I wonder if instead of folio_lru.c and folio_wait.c, we shouldn't simply
have folio.c. Tal has 700 lines in his diffstat, you'll have about 1100
lines, so that's about 1800 llines which seems like a good size.
There's some functions from mm/util.c that would fit nicely too --
folio_mapping(), folio_anon_vma(), folio_copy(), flush_dcache_folio()

Other people have thoughts?