Re: [PATCH] mm,hugetlb: Allocate frozen pages in alloc_buddy_hugetlb_folio
From: Matthew Wilcox
Date: Fri Apr 11 2025 - 10:23:18 EST
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;
> 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.
Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
Oscar, if you want to take on the gigantic allocation next ...
- I don't think we need folio_alloc_gigantic() to be wrapped in
alloc_hooks
- folio_alloc_gigantic() should return a frozen folio
- as should hugetlb_cma_alloc_folio()