Re: [PATCH 5/9] mm, page_alloc: pass zone pointer to trace_reclaim_retry_zone
From: Zi Yan
Date: Tue Oct 27 2026 - 14:42:26 EST
On 27 Oct 2026, at 11:46, Vlastimil Babka (SUSE) wrote:
> From: Josef Bacik <josef@xxxxxxxxxxxxxx>
>
> should_reclaim_retry() walks a zonelist and passes the zoneref pointer
> to the reclaim_retry_zone tracepoint, which loads the zone from the
> entry again to find the node.
>
> Memory hotplug rebuilds the zonelists in place while allocations are
> under way. When a zone in front of the zoneref entry has become empty,
> the entries move up, and this one can be the end marker by the time the
> tracepoint looks at it. zonelist_node_idx() then dereferences a NULL
> zone. Short of that, the event can name another zone than the one its
> numbers belong to.
>
> Pass the zone pointer instead of the zoneref pointer.
>
> Fixes: d379f01de095 ("oom, trace: add oom detection tracepoints")
> Cc: <stable@xxxxxxxxxxxxxxx>
> Assisted-by: LLM
> Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>
> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---
> include/trace/events/oom.h | 8 ++++----
> mm/page_alloc.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
Makes sense to me.
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi