Re: [PATCH] mm,hugetlb: Allocate frozen pages in alloc_buddy_hugetlb_folio

From: David Hildenbrand
Date: Fri Apr 11 2025 - 13:18:51 EST


On 11.04.25 16:21, Matthew Wilcox wrote:
On Fri, Apr 11, 2025 at 03:44:31PM +0200, David Hildenbrand wrote:
I assume htlb_alloc_mask() will always include _GFP_COMP.

static inline gfp_t htlb_alloc_mask(struct hstate *h)
{
gfp_t gfp = __GFP_COMP | __GFP_NOWARN;


I checked that as well and actually meant to say the I assume that we will here always have __GFP_COMP because the gfp_mask we get here will always be derived from htlb_alloc_mask().

But semantically, it might be wrong: __folio_alloc() will in the memdesc
world also make sure to allocate the memdesc, __alloc_frozen_pages() not.

Maybe one would want a __alloc_frozen_folio() .... @willy?

This is fine. Yes, it'll need to be modified when we get to the
separately allocated memdesc, but there's a number of places that
cast the freshly allocated page to a folio, and I'll have to come up
with a way to catch them all.

Okay, thanks for clarifying.

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

--
Cheers,

David / dhildenb