The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v4 00/19] mm: Refactor bootmem gigantic hugepage allocation
@ 2026-06-12  3:58 Muchun Song
  2026-06-12  3:58 ` [PATCH v4 01/19] mm/hugetlb: Fix boot panic with CONFIG_DEBUG_VM and HVO bootmem pages Muchun Song
                   ` (18 more replies)
  0 siblings, 19 replies; 22+ messages in thread
From: Muchun Song @ 2026-06-12  3:58 UTC (permalink / raw)
  To: Oscar Salvador, David Hildenbrand, Andrew Morton,
	Madhavan Srinivasan, Michael Ellerman
  Cc: Muchun Song, Mike Rapoport, Lorenzo Stoakes, Liam R . Howlett,
	Vlastimil Babka, linux-mm, linux-kernel, Nicholas Piggin,
	Christophe Leroy, Ritesh Harjani, Aneesh Kumar K . V,
	linuxppc-dev, Mike Kravetz, Muchun Song

This series is split out from the earlier larger series "mm: Generalize
HVO for HugeTLB and device DAX" [1]. It collects the first 19 patches of
that series as a standalone set of fixes and preparatory cleanups around
bootmem HugeTLB handling, sparse initialization ordering, and related
vmemmap setup.

The first patches fix a few bugs found while reviewing the existing
code, including incorrect bootmem HVO handling, wrong vmemmap
registration arguments, a powerpc compound-vmemmap tracking bug, and
too-late initialization of gigantic bootmem HugeTLB struct pages.

The rest of the series reorders early memory initialization so the
relevant zone state is available before sparse and HugeTLB boot-time
setup runs, then simplifies the remaining bootmem gigantic hugepage
allocation path and removes code made obsolete by that rework.

At a high level:
  - patches [1-4] fix boot-time and arch-specific bugs
  - patches [5-12] reorder and simplify sparse/mm/hugetlb early init
  - patches [13-19] refactor bootmem gigantic hugepage allocation and
    remove obsolete helpers and state

Changes since v3:
  - patches 2-4: add Cc: stable@vger.kernel.org to the applicable fixes
  - patch 3: collect Reviewed-by from Ritesh Harjani
  - patch 15: move pfn_to_zone() before hugetlb_vmemmap_init_early()
    instead of using a forward declaration
  - patches 15-17: collect Acked-by from Mike Rapoport where applicable
  - patch 15: collect Acked-by from Usama Arif
  - patch 18: clarify that the changelog also covers the early CMA
    bootmem allocation fallback refactoring
  - patch 19: initialize pgdat at declaration in
    __init_deferred_page() and collect Reviewed-by from Mike Rapoport

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

Muchun Song (19):
  mm/hugetlb: Fix boot panic with CONFIG_DEBUG_VM and HVO bootmem pages
  mm/hugetlb_vmemmap: Fix __hugetlb_vmemmap_optimize_folios()
  powerpc/mm: Fix wrong addr_pfn tracking in compound vmemmap population
  mm/hugetlb: Initialize gigantic bootmem hugepage struct pages earlier
  mm/mm_init: Simplify deferred_free_pages() migratetype init
  mm/sparse: Panic on memmap and usemap allocation failure
  mm/sparse: Move subsection_map_init() into sparse_init()
  mm/mm_init: Defer sparse_init() until after zone initialization
  mm/mm_init: Defer hugetlb reservation until after zone initialization
  mm/mm_init: Remove set_pageblock_order() call from sparse_init()
  mm/sparse: Move sparse_vmemmap_init_nid_late() into sparse_init_nid()
  mm/hugetlb_cma: Validate hugetlb CMA range by zone at reserve time
  mm/hugetlb: Refactor early boot gigantic hugepage allocation
  mm/hugetlb: Free cross-zone bootmem gigantic pages after allocation
  mm/hugetlb_vmemmap: Move bootmem HVO setup to early init
  mm/hugetlb: Remove obsolete bootmem cross-zone checks
  mm/sparse-vmemmap: Remove sparse_vmemmap_init_nid_late()
  mm/hugetlb: Remove unused bootmem cma field
  mm/mm_init: Fold __init_page_from_nid() into __init_deferred_page()

 arch/powerpc/mm/book3s64/radix_pgtable.c |   7 +-
 arch/powerpc/mm/hugetlbpage.c            |  13 +-
 include/linux/hugetlb.h                  |  24 +--
 include/linux/mmzone.h                   |   7 -
 mm/cma.c                                 |   3 +-
 mm/hugetlb.c                             | 259 +++++++++++------------
 mm/hugetlb_cma.c                         |  44 ++--
 mm/hugetlb_cma.h                         |   8 +-
 mm/hugetlb_vmemmap.c                     | 120 +++--------
 mm/hugetlb_vmemmap.h                     |   5 -
 mm/internal.h                            |  14 +-
 mm/mm_init.c                             |  86 +++-----
 mm/sparse-vmemmap.c                      |  26 ++-
 mm/sparse.c                              |  48 +----
 14 files changed, 251 insertions(+), 413 deletions(-)


base-commit: ec039126b7fac4e3af35ebccaa7c6f9b6875ba81
-- 
2.54.0

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

end of thread, other threads:[~2026-06-14  9:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12  3:58 [PATCH v4 00/19] mm: Refactor bootmem gigantic hugepage allocation Muchun Song
2026-06-12  3:58 ` [PATCH v4 01/19] mm/hugetlb: Fix boot panic with CONFIG_DEBUG_VM and HVO bootmem pages Muchun Song
2026-06-12  3:58 ` [PATCH v4 02/19] mm/hugetlb_vmemmap: Fix __hugetlb_vmemmap_optimize_folios() Muchun Song
2026-06-12 15:37   ` Frank van der Linden
2026-06-12  3:58 ` [PATCH v4 03/19] powerpc/mm: Fix wrong addr_pfn tracking in compound vmemmap population Muchun Song
2026-06-12  3:58 ` [PATCH v4 04/19] mm/hugetlb: Initialize gigantic bootmem hugepage struct pages earlier Muchun Song
2026-06-12  3:58 ` [PATCH v4 05/19] mm/mm_init: Simplify deferred_free_pages() migratetype init Muchun Song
2026-06-12  3:58 ` [PATCH v4 06/19] mm/sparse: Panic on memmap and usemap allocation failure Muchun Song
2026-06-12  3:58 ` [PATCH v4 07/19] mm/sparse: Move subsection_map_init() into sparse_init() Muchun Song
2026-06-12  3:58 ` [PATCH v4 08/19] mm/mm_init: Defer sparse_init() until after zone initialization Muchun Song
2026-06-12  3:58 ` [PATCH v4 09/19] mm/mm_init: Defer hugetlb reservation " Muchun Song
2026-06-12  3:58 ` [PATCH v4 10/19] mm/mm_init: Remove set_pageblock_order() call from sparse_init() Muchun Song
2026-06-12  3:58 ` [PATCH v4 11/19] mm/sparse: Move sparse_vmemmap_init_nid_late() into sparse_init_nid() Muchun Song
2026-06-12  3:58 ` [PATCH v4 12/19] mm/hugetlb_cma: Validate hugetlb CMA range by zone at reserve time Muchun Song
2026-06-12  3:58 ` [PATCH v4 13/19] mm/hugetlb: Refactor early boot gigantic hugepage allocation Muchun Song
2026-06-12  3:58 ` [PATCH v4 14/19] mm/hugetlb: Free cross-zone bootmem gigantic pages after allocation Muchun Song
2026-06-14  9:46   ` Mike Rapoport
2026-06-12  3:58 ` [PATCH v4 15/19] mm/hugetlb_vmemmap: Move bootmem HVO setup to early init Muchun Song
2026-06-12  3:59 ` [PATCH v4 16/19] mm/hugetlb: Remove obsolete bootmem cross-zone checks Muchun Song
2026-06-12  3:59 ` [PATCH v4 17/19] mm/sparse-vmemmap: Remove sparse_vmemmap_init_nid_late() Muchun Song
2026-06-12  3:59 ` [PATCH v4 18/19] mm/hugetlb: Remove unused bootmem cma field Muchun Song
2026-06-12  3:59 ` [PATCH v4 19/19] mm/mm_init: Fold __init_page_from_nid() into __init_deferred_page() Muchun Song

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