From: Pratyush Yadav <pratyush@kernel.org>
To: Chen Pei <cp0613@linux.alibaba.com>
Cc: rppt@kernel.org, pasha.tatashin@soleen.com,
pratyush@kernel.org, graf@amazon.com,
kexec@lists.infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kho: Skip zero-sized bootmem areas
Date: Mon, 26 Oct 2026 15:22:45 +0100 [thread overview]
Message-ID: <2vxzld7kpmmi.fsf@kernel.org> (raw)
In-Reply-To: <20261026131851.9942-1-cp0613@linux.alibaba.com> (Chen Pei's message of "Mon, 26 Oct 2026 21:18:51 +0800")
On Mon, Oct 26 2026, Chen Pei wrote:
> The lowmem and the global bootmem area are reserved unconditionally,
> while the per-node loop below already skips nodes whose size works out
> to 0. Either can legitimately be 0: the global size is the scaled total
> minus the lowmem one, so it is 0 whenever all measured reservations fit
> below ARCH_LOW_ADDRESS_LIMIT.
>
> Reserving 0 bytes still succeeds, so an area covering nothing gets
> recorded with a valid address. That is not neutral:
> kho_bootmem_overlap() reports an overlap for any request straddling
> that address, and memblock_alloc_hugetlb() aligns a request to its page
> size, so a 1G hugetlb allocation retries a free candidate on account of
> an area that holds nothing.
>
> A machine whose memory all starts at or above ARCH_LOW_ADDRESS_LIMIT
> hits the other side of the same code: the lowmem size is 0, the range
> below the limit is empty, the allocation fails and KHO is disabled
> although no lowmem area was needed.
>
> Skip a zero-sized area instead, as the per-node loop does. The
> descriptor count stays consistent, as kho_populate() derives it from
> the segment length that kho_fill_kimage() serialises.
>
> Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers")
> Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
Do you see zero sized lowmem or global scratch in practice? If yes, how?
What's your setup?
Note that I already fixed this for per-node areas since those do end up
with no allocations with movable_node set [0].
[0] https://lore.kernel.org/kexec/20261014131547.259138-1-pratyush@kernel.org/
[...]
--
Regards,
Pratyush Yadav
next prev parent reply other threads:[~2026-10-26 14:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 13:18 [PATCH] kho: Skip zero-sized bootmem areas Chen Pei
2026-10-26 13:23 ` sashiko-bot
2026-10-26 14:22 ` Pratyush Yadav [this message]
2026-10-27 7:40 ` Chen Pei
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=2vxzld7kpmmi.fsf@kernel.org \
--to=pratyush@kernel.org \
--cc=cp0613@linux.alibaba.com \
--cc=graf@amazon.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pasha.tatashin@soleen.com \
--cc=rppt@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.