linux/arch/powerpc/mm
Muchun Song 27ca02e689 mm/hugetlb: refactor early boot gigantic hugepage allocation
The early boot gigantic hugepage allocation helpers currently mix
allocation with huge_bootmem_page setup, and leave part of the
initialization flow in architecture code.

Refactor the interface to return the allocated huge page pointer and move
the huge_bootmem_page setup into the generic hugetlb code.  This makes the
architecture-specific paths focus only on finding memory, while the common
code handles node placement and early page metadata setup in one place.

This also lets powerpc benefit from memblock_reserved_mark_noinit(), which
it did not enable before.

In addition, upcoming cross-zone validation for boot-time gigantic hugetlb
reservation is common logic.  With this refactoring, that logic can stay
in the generic code instead of being duplicated in architecture-specific
paths.

Link: https://lore.kernel.org/20260612035903.2468601-14-songmuchun@bytedance.com
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Oscar Salvador (SUSE) <osalvador@suse.de>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Frank van der Linden <fvdl@google.com>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oscar Salvador (SUSE) <osalvador@kernel.org>
Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: Usama Arif <usama.arif@linux.dev>
Cc: Vlastimil Babka <vbabka@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-07-28 21:11:59 -07:00
..
book3s32 powerpc/32: Automatically adapt TASK_SIZE based on constraints 2026-01-07 09:31:05 +05:30
book3s64 powerpc/mm: fix wrong addr_pfn tracking in compound vmemmap population 2026-07-28 21:11:56 -07:00
kasan kasan: introduce ARCH_DEFER_KASAN and unify static key across modes 2025-09-21 14:21:58 -07:00
nohash powerpc/32: Automatically adapt TASK_SIZE based on constraints 2026-01-07 09:31:05 +05:30
ptdump powerpc/32s: Fix segments setup when TASK_SIZE is not a multiple of 256M 2026-01-07 09:31:04 +05:30
cacheflush.c powerpc: Fix typos 2024-05-08 00:21:30 +10:00
copro_fault.c cxl: Remove driver 2025-03-16 22:04:27 +11:00
dma-noncoherent.c
drmem.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
fault.c powerpc/mm/fault: Use str_write_read() helper function 2025-05-15 10:00:28 +05:30
hugetlbpage.c mm/hugetlb: refactor early boot gigantic hugepage allocation 2026-07-28 21:11:59 -07:00
init_32.c powerpc: Untangle fixmap.h and pgtable.h and mmu.h 2023-10-19 17:12:44 +11:00
init_64.c powerpc/mm: remove CONFIG_HAVE_BOOTMEM_INFO_NODE 2026-06-02 15:22:12 -07:00
init-common.c book3s64/radix: Refactoring common kfence related functions 2024-10-23 18:53:20 +11:00
ioremap_32.c powerpc: mm: convert to GENERIC_IOREMAP 2023-08-18 10:12:35 -07:00
ioremap_64.c powerpc/io: Remove PCI_FIX_ADDR 2025-02-26 21:15:08 +05:30
ioremap.c - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
maccess.c powerpc/inst: Optimise copy_inst_from_kernel_nofault() 2021-12-09 22:41:21 +11:00
Makefile mm: rename GENERIC_PTDUMP and PTDUMP_CORE 2025-03-17 00:05:32 -07:00
mem.c mm/sparse-vmemmap: pass @pgmap argument to memory deactivation paths 2026-05-28 21:04:54 -07:00
mmu_context.c powerpc/4xx: Remove CONFIG_BOOKE_OR_40x 2024-06-28 22:28:48 +10:00
mmu_decl.h powerpc: Remove core support for 40x 2024-06-28 22:28:47 +10:00
numa.c arch, mm: consolidate initialization of SPARSE memory model 2026-01-26 20:02:18 -08:00
pageattr.c powerpc: Don't ignore errors from set_memory_{n}p() in __kernel_map_pages() 2024-03-03 22:18:45 +11:00
pgtable_32.c powerpc/32: Remove PAGE_KERNEL_TEXT to fix startup failure 2025-09-16 16:16:00 +05:30
pgtable_64.c mm/treewide: replace pXd_huge() with pXd_leaf() 2024-04-25 20:55:46 -07:00
pgtable-frag.c powerpc/pgtable-frag: Fix bad page state in pte_frag_destroy 2026-03-17 13:56:36 +05:30
pgtable.c powerpc/mm: support page table check 2026-01-26 20:02:36 -08:00