[PATCH 1/2] kho: skip zero-sized lowmem and global bootmem areas

Mike Rapoport rppt at kernel.org
Wed Nov 4 08:50:04 PST 2026


On Wed, Nov 04, 2026 at 10:32:14AM -0500, Pasha Tatashin wrote:
> On 11-04 13:22, Mike Rapoport wrote:
> > On Tue, Nov 03, 2026 at 02:48:36PM -0500, Pasha Tatashin wrote:
> > > > @@ -852,56 +873,32 @@ static void __init kho_reserve_bootmem(void)
> > > >  	 * reserve bootmem area in low memory for lowmem allocations in the
> > > >  	 * next kernel
> > > >  	 */
> > > > -	size = bootmem_size_lowmem;
> > > > -	addr = memblock_phys_alloc_range(size, BOOTMEM_ALIGNMENT_BYTES, 0,
> > > > -					 ARCH_LOW_ADDRESS_LIMIT);
> > > > -	if (!addr) {
> > > > +	if (kho_reserve_bootmem_area(&i, bootmem_size_lowmem,
> > > > +				     ARCH_LOW_ADDRESS_LIMIT, NUMA_NO_NODE)) {
> > > >  		pr_err("Failed to reserve lowmem bootmem\n");
> > > 
> > > You are adding a helper that returns an error code and then ignoring it 
> > > at all call sites. Even though it can only return -ENOMEM right now, 
> > > dropping the return value is not good practice.
> > 
> > I don't think error code is important here.
> 
> Perhaps, but it is just not elegant to add a function that returns an 
> error, call that function from three places, and ignore that error every 
> time.

Because it's not important what the error was. 
 
> What is wrong with:
> 
> err = kho_reserve_bootmem_area(...);
> if (err) {
>         pr_err("Failed to reserve lowmem bootmem: %pe\n", ERR_PTR(err));
>         ...
> }

More churn for no value?

> -- 
> Pasha

-- 
Sincerely yours,
Mike.



More information about the kexec mailing list