v2
2026-07-20
uffd-wp 文件 folio 批量取消映射 · v2
补丁系列批量处理 uffd-wp 文件 folio 的取消映射,减少 try_to_unmap_one 中的认知负担。
原始补丁链接
子 Patch(3)
1/3
mm/memory: move pte_install_uffd_wp_if_needed() into memory.c
pte_install_uffd_wp_if_needed() has grown too large for mm_inline.h. Move it to memory.c. This helper is only used inside mm/, so declare it in mm/internal.h instead of a public header. While at it,
2/3
mm/memory: batch set uffd-wp markers during zapping
Enable batch setting of uffd-wp PTE markers. The code paths passing nr > 1 to zap_install_uffd_wp_if_needed() produce that nr through either folio_pte_batch() or swap_pte_batch(), therefore batching
3/3
mm/rmap: batch unmap file folios belonging to uffd-wp VMAs
Commit a67fe41e214f (“mm: rmap: support batched unmapping for file large folios”) extended batched unmapping for file folios. That also required making pte_install_uffd_wp_if_needed() support batching