# Re: \[PATCH v4 14/19\] mm/hugetlb: Free cross-zone bootmem gigantic pages after allocation

- From: Mike Rapoport \<rppt@kernel.org\>
- Date: 2026-06-14 09:46:53 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2026/06/17130089
- Thread: https://ratatoskr.run/linux-mm/2026/06/17123350/t.md

```text
On Fri, Jun 12, 2026 at 11:58:58AM +0800, Muchun Song wrote:
> Now that hugetlb reservation runs after zone initialization, bootmem
> gigantic page allocation can detect pages that span multiple zones.
> 
> Keep those cross-zone pages separate during allocation and free them
> after allocation completes, so later hugetlb initialization only sees
> zone-valid gigantic pages.
> 
> This chooses to free cross-zone gigantic pages directly instead of
> retrying allocation. In practice, such cross-zone cases are expected to
> be very rare, so adding retry logic does not seem justified at this
> point. Keeping the handling simple also preserves the previous behavior.
> If similar real-world reports show up later, retry support can be
> reconsidered then.
> 
> Signed-off-by: Muchun Song <redacted>

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
>  mm/hugetlb.c | 75 ++++++++++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 64 insertions(+), 11 deletions(-)

-- 
Sincerely yours,
Mike.

```
