The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 00/17] mm: Introduce section-based vmemmap optimization for HugeTLB
@ 2026-07-02  9:38 Muchun Song
  2026-07-02  9:38 ` [PATCH 01/17] mm/sparse: drop power-of-2 size requirement for struct mem_section Muchun Song
                   ` (16 more replies)
  0 siblings, 17 replies; 24+ messages in thread
From: Muchun Song @ 2026-07-02  9:38 UTC (permalink / raw)
  To: Andrew Morton, Oscar Salvador, David Hildenbrand, linux-mm
  Cc: Mike Rapoport, Vlastimil Babka, Lorenzo Stoakes, Michal Hocko,
	linux-kernel, Muchun Song, muchun.song

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: making the generic sparse-vmemmap code
section-based optimization aware and switching HugeTLB bootmem pages to
this path.

HugeTLB vmemmap optimization currently has its own early boot setup
path.  It pre-populates optimized vmemmap mappings before the normal
sparse-vmemmap population code runs, and sparsemem carries
SPARSEMEM_VMEMMAP_PREINIT only to support that special case.

That makes the HugeTLB vmemmap optimization path harder to share with
other users of sparse-vmemmap optimization and leaves a fair amount of
HugeTLB-specific boot-time state in the generic memory initialization
flow.

This series introduces section-based vmemmap optimization support in
the sparse-vmemmap code and switches HugeTLB bootmem pages over to it.
Instead of having HugeTLB pre-populate optimized vmemmap mappings
itself, HugeTLB now records the compound page order in the corresponding
memory sections.  The generic sparse-vmemmap population path can then
allocate or reuse shared tail vmemmap pages based on section metadata.

The patches are organized as follows:

  - patches 1-3 prepare sparsemem and vmemmap optimization metadata
  - patches 4-7 teach the common sparse-vmemmap paths to use that state
  - patches 8-9 switch HugeTLB bootmem optimization to the section-based path
  - patches 10-17 clean up sparsemem and HugeTLB bootmem code that is no
    longer needed after the conversion

This is intended to be the second smaller step toward the broader HVO
generalization.  The device DAX conversion and the wider HVO
consolidation are left for follow-up series.

[1] https://lore.kernel.org/linux-mm/20260513130542.35604-1-songmuchun@bytedance.com/

Muchun Song (17):
  mm/sparse: drop power-of-2 size requirement for struct mem_section
  mm/sparse-vmemmap: track compound page order in struct mem_section
  mm/sparse-vmemmap: introduce folio-oriented vmemmap optimization
    macros
  mm/mm_init: skip initializing shared vmemmap tail pages
  mm/sparse-vmemmap: initialize shared tail vmemmap pages on allocation
  mm/sparse-vmemmap: support section-based vmemmap accounting
  mm/sparse-vmemmap: support section-based vmemmap optimization
  mm/sparse: mark memory sections present earlier
  mm/hugetlb: switch HugeTLB to section-based vmemmap optimization
  mm/mm_init: factor out pfn_to_zone()
  mm/sparse-vmemmap: remove SPARSEMEM_VMEMMAP_PREINIT support
  mm/sparse: inline usemap allocation into sparse_init_nid()
  mm/sparse: remove section_map_size()
  mm/hugetlb: remove HUGE_BOOTMEM_HVO
  mm/hugetlb: remove HUGE_BOOTMEM_CMA
  mm/hugetlb: localize struct huge_bootmem_page
  mm/hugetlb: localize HUGE_BOOTMEM_ZONES_VALID

 arch/x86/Kconfig        |   1 -
 fs/Kconfig              |   1 -
 include/linux/hugetlb.h |   9 +--
 include/linux/mm.h      |   4 --
 include/linux/mmzone.h  | 113 ++++++++++++++++++++++-------------
 mm/Kconfig              |   5 --
 mm/bootmem_info.c       |   5 +-
 mm/hugetlb.c            |  63 +++++---------------
 mm/hugetlb_vmemmap.c    | 123 +++++---------------------------------
 mm/hugetlb_vmemmap.h    |  13 ++--
 mm/internal.h           |  29 ++++++---
 mm/mm_init.c            |  54 ++++++++++++-----
 mm/sparse-vmemmap.c     | 128 +++++++++++++---------------------------
 mm/sparse.c             | 102 ++++++++++++--------------------
 scripts/gdb/linux/mm.py |   6 +-
 15 files changed, 254 insertions(+), 402 deletions(-)


base-commit: 4f441960e691d37c880d2cc004de06bb5b6bd5e4
-- 
2.54.0

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2026-07-09 13:25 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02  9:38 [PATCH 00/17] mm: Introduce section-based vmemmap optimization for HugeTLB Muchun Song
2026-07-02  9:38 ` [PATCH 01/17] mm/sparse: drop power-of-2 size requirement for struct mem_section Muchun Song
2026-07-02  9:38 ` [PATCH 02/17] mm/sparse-vmemmap: track compound page order in " Muchun Song
2026-07-02  9:38 ` [PATCH 03/17] mm/sparse-vmemmap: introduce folio-oriented vmemmap optimization macros Muchun Song
2026-07-02  9:38 ` [PATCH 04/17] mm/mm_init: skip initializing shared vmemmap tail pages Muchun Song
2026-07-09 10:45   ` Mike Rapoport
2026-07-09 12:31     ` Muchun Song
2026-07-09 13:05       ` Mike Rapoport
2026-07-09 13:23         ` Muchun Song
2026-07-02  9:38 ` [PATCH 05/17] mm/sparse-vmemmap: initialize shared tail vmemmap pages on allocation Muchun Song
2026-07-02  9:38 ` [PATCH 06/17] mm/sparse-vmemmap: support section-based vmemmap accounting Muchun Song
2026-07-02  9:38 ` [PATCH 07/17] mm/sparse-vmemmap: support section-based vmemmap optimization Muchun Song
2026-07-02  9:38 ` [PATCH 08/17] mm/sparse: mark memory sections present earlier Muchun Song
2026-07-09 10:54   ` Mike Rapoport
2026-07-09 12:35     ` Muchun Song
2026-07-02  9:38 ` [PATCH 09/17] mm/hugetlb: switch HugeTLB to section-based vmemmap optimization Muchun Song
2026-07-02  9:38 ` [PATCH 10/17] mm/mm_init: factor out pfn_to_zone() Muchun Song
2026-07-02  9:38 ` [PATCH 11/17] mm/sparse-vmemmap: remove SPARSEMEM_VMEMMAP_PREINIT support Muchun Song
2026-07-02  9:38 ` [PATCH 12/17] mm/sparse: inline usemap allocation into sparse_init_nid() Muchun Song
2026-07-02  9:38 ` [PATCH 13/17] mm/sparse: remove section_map_size() Muchun Song
2026-07-02  9:38 ` [PATCH 14/17] mm/hugetlb: remove HUGE_BOOTMEM_HVO Muchun Song
2026-07-02  9:38 ` [PATCH 15/17] mm/hugetlb: remove HUGE_BOOTMEM_CMA Muchun Song
2026-07-02  9:38 ` [PATCH 16/17] mm/hugetlb: localize struct huge_bootmem_page Muchun Song
2026-07-02  9:38 ` [PATCH 17/17] mm/hugetlb: localize HUGE_BOOTMEM_ZONES_VALID Muchun Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox