From: "David Hildenbrand (Arm)" <david@kernel.org>
To: Gregory Price <gourry@gourry.net>, linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org,
kernel-team@meta.com, osalvador@suse.de,
akpm@linux-foundation.org, rppt@kernel.org,
mgorman@techsingularity.net, hannes@cmpxchg.org,
vbabka@kernel.org, Sashiko <sashiko-bot@kernel.org>
Subject: Re: [PATCH v2] mm/mm_init: handle alloc_percpu failure in free_area_init_core_hotplug
Date: Thu, 2 Jul 2026 10:02:11 +0200 [thread overview]
Message-ID: <0dfa1f14-bf5e-4e02-bf4a-8b718c2774fe@kernel.org> (raw)
In-Reply-To: <20260701221613.2818148-1-gourry@gourry.net>
On 7/2/26 00:16, Gregory Price wrote:
> We miss a failed allocation check for pgdat->per_cpu_nodestats, which
> results in a NULL deref when we offset into the per-cpu area.
>
> Propagate -ENOMEM up the stack and leave per_cpu_nodestats pointing
> at boot_nodestats so a later online can retry the allocation.
>
> hotadd_init_pgdat() returns NULL on failure, which __try_online_node()
> already maps to -ENOMEM.
>
> On failure nothing needs to be unwound:
> - the node is never marked online
> - per_cpu_nodestats is left pointing at boot_nodestats
> - __add_memory_resource() cleans up pending memblock resources
> - later online attempts retry the per_cpu_nodestats allocation
>
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Link: https://sashiko.dev/#/patchset/20260627202243.758289-1-gourry%40gourry.net
> Fixes: 75ef71840539 ("mm, vmstat: add infrastructure for per-node vmstats")
> Signed-off-by: Gregory Price <gourry@gourry.net>
> ---
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
next prev parent reply other threads:[~2026-07-02 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 22:16 [PATCH v2] mm/mm_init: handle alloc_percpu failure in free_area_init_core_hotplug Gregory Price
2026-07-02 8:02 ` David Hildenbrand (Arm) [this message]
2026-07-02 8:59 ` Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0dfa1f14-bf5e-4e02-bf4a-8b718c2774fe@kernel.org \
--to=david@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=gourry@gourry.net \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@meta.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=osalvador@suse.de \
--cc=rppt@kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=vbabka@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox