[PATCH v3 0/2] mm: folio conversion and refactoring in do_swap_page()

From: Hongfu Li

Date: Mon Jul 27 2026 - 12:22:00 EST


From: Hongfu Li <lihongfu@xxxxxxxxxx>

Convert the device-private migration path in do_swap_page() to use
folio APIs, then extract all non-swap entry handling into a new
do_non_swap_page() helper to improve readability and reduce the
size of the main swap fault function.

Hongfu Li (2):
mm: Use a folio in the softleaf_is_device_private path
mm: Extract non-swap entry handling to do_nonswap_softleaf()

mm/memory.c | 118 ++++++++++++++++++++++++++++++----------------------
1 file changed, 68 insertions(+), 50 deletions(-)

---
v3:
- Rename do_non_swap_page() to do_nonswap_softleaf().
- Update the commit subject and body of patch 2/2 accordingly.
- Drop a blank line after the device_private condition in
do_nonswap_softleaf().
v2:
- Drop fault_folio, reuse the existing folio variable instead
- Refresh commit messages
- Update comment to use "folio" instead of "page" in the
device_private path
- Add Acked-by: David Hildenbrand
- Add patch 2/2 to extract do_non_swap_page() from do_swap_page()
- Link to v1: https://lore.kernel.org/all/20260721013347.65698-1-hongfu.li@xxxxxxxxx/
--
2.54.0