[PATCH 0/8] mm/khugepaged: collapse_file() cleanups
From: Pedro Falcato
Date: Mon Jul 20 2026 - 10:36:19 EST
Here are a bunch of cleanups for collapse_file() that attempt to aid
code readability and understanding. This is part 1 out of N, and only
attempts to address the main collapse loop. The exit path is still a
mess but I figure it's much easier to review if I send this batch as-is,
versus sending the whole thing.
Based on top of latest mm-unstable.
Cc: Zi Yan <ziy@xxxxxxxxxx>
Cc: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>
Cc: "Liam R. Howlett" <liam@xxxxxxxxxxxxx>
Cc: Nico Pache <npache@xxxxxxxxxx>
Cc: Ryan Roberts <ryan.roberts@xxxxxxx>
Cc: Dev Jain <dev.jain@xxxxxxx>
Cc: Barry Song <baohua@xxxxxxxxxx>
Cc: Lance Yang <lance.yang@xxxxxxxxx>
Cc: Usama Arif <usama.arif@xxxxxxxxx>
Cc: linux-mm@xxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Pedro Falcato (8):
mm/khugepaged: separate out windy folio logic from collapse_file
mm/khugepaged: factor out page cache folio reading
mm/khugepaged: factor out and simplify dirty/writeback handling
mm/khugepaged: simplify prepare folio locking and exit paths
mm/khugepaged: add kerneldoc to prepare_collapse_file_folio()
mm/khugepaged: hoist isolation into collapse_isolate_folio()
mm/khugepaged: hoist more code into collapse_isolate_folio()
mm/khugepaged: fix and flesh out try_to_unmap_flush() comment
mm/khugepaged.c | 424 ++++++++++++++++++++++++++++--------------------
1 file changed, 248 insertions(+), 176 deletions(-)
--
2.55.0