Re: [PATCH v5 01/12] mm/page_alloc: reset can_retry_reserves when the slowpath restarts

From: Zi Yan

Date: Sun Nov 01 2026 - 14:53:14 EST


On Sat Oct 31, 2026 at 10:13 PM EDT, Gregory Price (Meta) wrote:
> Commit 2c4c3e29897d ("mm/page_alloc: simplify __alloc_pages_slowpath()
> flow") retries an allocation once with reserve_flags when the caller
> becomes eligible for reserves, guarded by can_retry_reserves.
>
> A restart after a cpuset update or a zonelist rebuild retries with
> can_retry_reserves already set to false, so a caller that cannot
> reclaim (GFP_NOWAIT | __GFP_MEMALLOC), fails without trying reserves.
>
> Reset can_retry_reserves on restart. Only a cpuset or zonelist change
> restarts the slowpath, so the retry still runs at most once per change.
>
> With a kprobe helping to make the race deterministic, an allocation
> can be made to return NULL. With this patch the allocation will succeed.
>
> Fixes: 2c4c3e29897d ("mm/page_alloc: simplify __alloc_pages_slowpath() flow")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
> ---
> mm/page_alloc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>

LGTM.

Acked-by: Zi Yan <ziy@xxxxxxxxxx>

--
Best Regards,
Yan, Zi