v1 2026-09-30

清理 folio->page 引用 · v1

为配合 memdescs 把 struct folio 与 struct page 解耦,将 mm/ 下 25 个文件中残留的 &folio->page 引用改为 folio_page(),仅剩一处未转换。

原始补丁链接

子 Patch(15)

1/15
mm/khugepaged: drop redundant page parameter from set_huge_pmd()
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. set_huge_pmd() is a static helper with a single caller that passes
2/15
mm/huge_memory: use folio_page() in PMD/PUD rmap, zap, and migration
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace direct &folio->page uses with folio_page(folio, 0) in inse
3/15
mm/huge_memory: use folio_page() in THP split paths
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace direct &folio->page uses and pointer arithmetic with folio
4/15
mm/hugetlb_vmemmap: use folio_page() for vmemmap address arithmetic
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace direct (unsigned long)&folio->page casts and the implicit
5/15
mm/hugetlb_cma: use folio_page() in hugetlb_cma_free_frozen_folio()
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Pass folio_page(folio, 0) instead of &folio->page to cma_release_f
6/15
mm/hugetlb: replace &folio->page with folio_page() and VM_BUG_ON_FOLIO()
为 memdescs 将 folio 独立分配、不再覆盖 head page 做准备,hugetlb_wp() 等处把 &folio->page 替换为 folio_page(folio,0),并把 VM_BUG_ON_PAGE 改为 VM_BUG_ON_FOLIO,避免直接引用该字段,行为不变。
7/15
mm/page_isolation: use folio_page() in page_is_unmovable()
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace &folio->page with folio_page(folio, 0) when passing the he
8/15
mm/compaction: stop casting free pages to struct folio
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. In compaction_alloc_noprof(), pass freepage directly to post_alloc
9/15
mm/migrate, vmscan: use folio_page() for movable_ops helpers
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace direct &folio->page, &src->page, and &dst->page uses with
10/15
mm/memory: use folio_page() in fault and CoW paths
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace direct &folio->page and &new_folio->page uses with folio_p
11/15
mm/rmap, gup: use folio_page() for PageAnonExclusive and gup_must_unshare
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace &folio->page with folio_page(folio, 0) when checking or se
12/15
mm/ksm, userfaultfd: replace &folio->page with folio_page()
为 folio 与 page 分离做准备,在 KSM 树比较/合并及 userfaultfd 缺页填充/搬移路径中,把 &folio->page、&kfolio->page 等统一替换为 folio_page(…,0),消除对 folio 覆盖 head page 的依赖,行为不变。
13/15
mm/page_alloc, folio: use folio_page() when freeing folios
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace &folio->page with folio_page(folio, 0) in __folio_put() an
14/15
mm/page_owner, alloc_tag: use folio_page() for page_ext and codetag
As part of the memdescs effort, struct folio will be allocated separately from struct page and will no longer overlay the head page. Replace direct &folio->page, &old->page, &new->page, and &newfolio
15/15
mm: replace remaining &folio->page uses with folio_page() and helpers
为 memdescs 收尾:memory-failure、filemap 等剩余 &folio->page 改用 folio_page(folio,0),mf_generic_kill_procs() 用 folio_set_hwpoison(),错误返回用 ERR_CAST(folio),并保证 free_zone_device_folio() 的 wake_up_var 键仍与 dax 等待的 page 地址一致。