[PATCH] kho: do not reserve empty per-node bootmem areas

Pratyush Yadav pratyush at kernel.org
Wed Oct 14 06:39:10 PDT 2026


On Wed, Oct 14 2026, sashiko-bot at kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] kho: incomplete fix for zero-size memblock allocations in bootmem
> --
>
> commit 67ab500bd948f5a3b52f1c8170626cb8f1dfc6c3
> Author: Pratyush Yadav (Google) <pratyush at kernel.org>
>
> kho: do not reserve empty per-node bootmem areas
>
> Some nodes do not allocate any early boot memory, causing memblock to
> return an address without reserving anything when requested with zero size.
> This address is recorded in kho_bootmem with a size of 0, and can cause KHO
> to fail to initialize. This patch skips bootmem reservation for memoryless
> nodes entirely.
>
>> diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
>> index 7018e25e4eda1..6f1f55fe31819 100644
>> --- a/kernel/liveupdate/kexec_handover.c
>> +++ b/kernel/liveupdate/kexec_handover.c
>
> [ ... ]
>
>> @@ -882,6 +882,9 @@ static void __init kho_reserve_bootmem(void)
>>  	 */
>>  	for_each_node_state(nid, N_MEMORY) {
>>  		size = bootmem_size_node(nid);
>> +		if (!size)
>> +			continue;
>> +
>>  		addr = memblock_alloc_range_nid(size, BOOTMEM_ALIGNMENT_BYTES,
>
> [Severity: High]
> This adds a zero-size check for per-node bootmem allocations, but does the
> same issue exist for bootmem_size_lowmem and bootmem_size_global?

Valid point, but that should be solved by the general bootmem sizing
patches being developed separately.

[...]

-- 
Regards,
Pratyush Yadav



More information about the kexec mailing list