[PATCH v2] liveupdate: kho: calculate per-node bootmem sizes before allocating any
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Oct 29 03:39:06 PDT 2026
> From: George Guo <guodongtai at kylinos.cn>
>
> kho_reserve_bootmem() calculated the per-node bootmem sizes inside the
> allocation loop, after the lowmem and global areas had been allocated.
>
> Without CONFIG_NUMA, memblock_get_region_node() returns 0 for every
> region, and memblock_reserved_kern_size() attributes a region to a node
> by memblock_get_region_node(). Since allocations are marked
> MEMBLOCK_RSRV_KERN, the newly allocated lowmem and global areas enter
> node 0's baseline and are scaled again by bootmem_size_node().
>
> In the original 1 GiB QEMU reproducer, the default 200% scale made
> node 0 request 672 MiB: twice the sum of the 98.45 MiB baseline and
> 224 MiB lowmem area, rounded up to 32 MiB alignment. The reservation
> failed and KHO disabled itself.
> [ ... ]
> Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers")
> Reported-by: Kexin Liu <liukexin at kylinos.cn>
> Co-developed-by: Kexin Liu <liukexin at kylinos.cn>
> Signed-off-by: Kexin Liu <liukexin at kylinos.cn>
> Signed-off-by: George Guo <guodongtai at kylinos.cn>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261029103425.14689-1-dongtai.guo@linux.dev?part=1
More information about the kexec
mailing list