[LTP] [PATCH v2 0/3] hugemmap10: Account for memory policy in counter checks

Huaisheng Ye yehuaisheng@open-hieco.net
Tue Sep 29 09:24:09 CEST 2026


The hugetlb reservation fix allocates surplus hugepages when global free
pages are outside nodes allowed by the current cpuset and MPOL_BIND policy.
This series updates hugemmap10's global counter expectations to match that
behavior.

Patch 1 fixes mappings that create their reservation at mmap() time. Patches
2 and 3 add and validate a MAP_NORESERVE private-mapping mode, which lets the
test exercise fault-time reservations without booting an older kernel.

Changes in v2:
- Expand the v1 change[1] from mmap-time to private fault-time accounting
  patches, with the MAP_NORESERVE test mode between them.
- Match hugetlb's MPOL_BIND behavior when its policy mask no longer overlaps
  the current cpuset: fall back to the cpuset mask instead of treating the
  allowed set as empty.
- Normalize nodemask bit tests to avoid truncating bits in the upper half of
  an unsigned long on 64-bit systems.
- Add -n to map only private VMAs with MAP_NORESERVE. The reservation probe
  uses the same flags, so the private_resv debug report reflects the actual
  private mapping behavior. MAP_SHARED mappings are unchanged.
- Account for the allowed-node shortfall when an unreserved private mapping
  first faults in touch_(), and share the reservation predicate with unmap_().

[1] https://lore.kernel.org/ltp/20260914032359.9956-1-yehuaisheng@open-hieco.net/

Huaisheng Ye (3):
  hugemmap10: Account for memory policy in mmap counter checks
  hugemmap10: Add private MAP_NORESERVE test mode
  hugemmap10: Account for memory policy in private fault checks

 .../kernel/mem/hugetlb/hugemmap/hugemmap10.c  | 156 ++++++++++++++++--
 1 file changed, 141 insertions(+), 15 deletions(-)

-- 
2.52.0



More information about the ltp mailing list