]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
kho: skip memoryless NUMA nodes when reserving scratch areas
authorEvangelos Petrongonas <epetron@amazon.de>
Tue, 20 Jan 2026 17:59:11 +0000 (17:59 +0000)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:20 +0000 (07:21 -0500)
commitf86582890bd7a72a75293e4abbf84c17bca4e754
treeec2b3242323bffdb2092df82691b195955c6d7cf
parentfdf605f64f824c1b363b591dca96b6ea2bdef607
kho: skip memoryless NUMA nodes when reserving scratch areas

[ Upstream commit 427b2535f51342de3156babc6bdc3f3b7dd2c707 ]

kho_reserve_scratch() iterates over all online NUMA nodes to allocate
per-node scratch memory.  On systems with memoryless NUMA nodes (nodes
that have CPUs but no memory), memblock_alloc_range_nid() fails because
there is no memory available on that node.  This causes KHO initialization
to fail and kho_enable to be set to false.

Some ARM64 systems have NUMA topologies where certain nodes contain only
CPUs without any associated memory.  These configurations are valid and
should not prevent KHO from functioning.

Fix this by only counting nodes that have memory (N_MEMORY state) and skip
memoryless nodes in the per-node scratch allocation loop.

Link: https://lkml.kernel.org/r/20260120175913.34368-1-epetron@amazon.de
Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers").
Signed-off-by: Evangelos Petrongonas <epetron@amazon.de>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/kexec_handover.c