Re: [PATCH v2 13/69] mm/hugetlb: Refactor early boot gigantic hugepage allocation
From: Oscar Salvador (SUSE)
Date: Mon May 25 2026 - 13:22:02 EST
On Wed, May 13, 2026 at 09:04:41PM +0800, Muchun Song wrote:
> 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.
>
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
Same comment as Mike:
Reviewed-by: Oscar Salvador (SUSE) <osalvador@xxxxxxx>
--
Oscar Salvador
SUSE Labs