v1
2026-08-07
交换页读写路径 folio 化清理 · v1
将 mm/page_io.c 剩余 struct page 用法转为 folio,删除 PageReclaim 等访问器并重命名 __swap_writepage。
原始补丁链接
子 Patch(6)
1/6
mm/page_io: convert write completion handlers to folios
Convert swap_write_end() and swap_fs_write_complete() to operate on folios directly instead of going through the folio-compat page APIs. This removes calls to end_page_writeback() and set_page_dirty()
2/6
mm: remove PageReclaim
This flag is now only used on folios, so we can remove all the page accessors. Signed-off-by: Tal Zussman tz2294@columbia.edu — include/linux/page-flags.h | 4 ++– 1 file changed , 2 insertions
3/6
mm/page_io: use swap entries directly in zeromap helpers
Increment swp_entry_t::val directly instead of recomputing each entry with page_swap_entry(). This removes the last struct page usage in page_io.c and saves one call to compound_head() per page. Sign
4/6
mm/page_io: rename bio_associate_blkg_from_page()
This function takes a folio. Rename it to bio_associate_blkg_from_folio() accordingly. While at it, convert the macro in the !CONFIG_MEMCG || !CONFIG_BLK_CGROUP case to a function. Signed-off-by: Tal
5/6
mm/page_io: refer to folios in swap_writeout() comments
swap_writeout() operates on folios, not pages. Update its comments accordingly. Signed-off-by: Tal Zussman tz2294@columbia.edu — mm/page_io.c | 4 ++– 1 file changed , 2 insertions(+), 2 deleti
6/6
mm/swap: rename __swap_writepage() to __swap_writeout()
Commit 84798514db50 (“mm: Remove swap_writepage() and shmem_writepage()”) renamed swap_writepage() to swap_writeout(). Rename __swap_writepage(), which operates on a folio, to match its caller. Updat