Re: [PATCH 2/4] mm: hugetlb: skip CMA allocations under PF_MEMALLOC_PIN
From: Muchun Song
Date: Tue Nov 03 2026 - 03:51:22 EST
> On Nov 3, 2026, at 16:01, Qi Zheng <qi.zheng@xxxxxxxxx> wrote:
>
> From: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
>
> With gigantic overcommit enabled, a fault during long-term pinning
> can allocate a fresh HugeTLB folio from CMA despite PF_MEMALLOC_PIN.
>
> The folio must then be migrated before it can be pinned. However,
> fresh gigantic migration targets are not supported, so pinning fails
> when the HugeTLB pool has no suitable target, even if the original
> fault could have allocated pinnable memory outside CMA.
>
> Honor PF_MEMALLOC_PIN in the HugeTLB CMA allocator so the fault can
> try the non-CMA fallback, or fail when allocation is restricted to CMA.
>
> Fixes: eb02f14c4a2b ("mm/hugetlb: allow overcommitting gigantic hugepages")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
LGTM.
Acked-by: Muchun Song <muchun.song@xxxxxxxxx>
Thanks.