[PATCH 0/4] mm: Enforce read-only shared vmemmap tail mappings

From: Muchun Song

Date: Mon Oct 19 2026 - 05:12:21 EST


This series is split out from the earlier, larger series "mm: Generalize
HVO for HugeTLB and device DAX" [1]. While the parent series generalizes
vmemmap optimization across HugeTLB and device DAX, this subset addresses
a single, self-contained step: mapping shared vmemmap tail pages read-only
at population time.

After the previous HugeTLB and device DAX conversions, both can install
optimized shared-tail mappings during vmemmap population. These mappings
should be read-only because each shared tail vmemmap page backs metadata
for many tail pages. HugeTLB applies this protection in a later,
subsystem-specific pass, but device DAX currently lacks it.

This series moves the protection into the generic sparse-vmemmap and
powerpc radix population paths. This protects device DAX mappings and
makes the HugeTLB-specific vmemmap_wrprotect_hvo() pass redundant. With
that pass gone, the bootmem-only optimization wrapper has no distinct
work and is removed as well.

This is intended to be the fifth smaller step toward the broader HVO
generalization. The remaining HVO naming and enablement consolidation is
left for follow-up series.

[1] https://lore.kernel.org/all/20260513130542.35604-1-songmuchun@xxxxxxxxxxxxx/

Muchun Song (4):
mm/sparse-vmemmap: map shared vmemmap tail pages as read-only
powerpc/mm: map shared vmemmap tail pages as read-only
mm/hugetlb_vmemmap: remove vmemmap_wrprotect_hvo()
mm/hugetlb_vmemmap: remove hugetlb_vmemmap_optimize_bootmem_folios()

Documentation/mm/vmemmap_dedup.rst | 3 +-
arch/powerpc/mm/book3s64/radix_pgtable.c | 3 ++
include/linux/mm.h | 2 --
mm/hugetlb.c | 2 +-
mm/hugetlb_vmemmap.c | 45 +++++-------------------
mm/hugetlb_vmemmap.h | 6 ----
mm/sparse-vmemmap.c | 26 ++------------
7 files changed, 17 insertions(+), 70 deletions(-)


base-commit: 2887e63d2e8e0cf55402612d8996ce955a2c3e55
--
2.54.0