From: "Jose A. Perez de Azpillaga" <azpijr@gmail.com>
To: Mike Rapoport <rppt@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Kees Cook <kees@kernel.org>, Alexander Graf <graf@amazon.com>,
Changyuan Lyu <changyuanl@google.com>
Cc: Tony Luck <tony.luck@intel.com>,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Pratyush Yadav <pratyush@kernel.org>,
Pasha Tatashin <pasha.tatashin@soleen.com>,
kexec@lists.infradead.org,
"Jose A. Perez de Azpillaga" <azpijr@gmail.com>
Subject: [RFC PATCH 0/2] memblock: keep reserve_mem regions out of KHO bootmem
Date: Wed, 21 Oct 2026 23:10:44 +0200 [thread overview]
Message-ID: <20261021211058.83483-1-azpijr@gmail.com> (raw)
On a KHO boot, a reserve_mem= region that can't be revived (new name,
size or alignment) can be allocated from KHO bootmem, which the next
kernel boots out of. With CONFIG_KEXEC_HANDOVER_DEBUG preserving it
fails; without it, the next kernel's memmap ends up on top of it.
Patch 1 factors the bootmem check out of memblock_alloc_hugetlb(), and
patch 2 uses it for reserve_mem. That also drops the TODO in
reserve_mem(), which asks for the allocation to be outside KHO_NOPRSRV,
though it's bootmem it has to stay out of.
Questions:
- If kho_discover_noprsrv() fails, only bootmem is NOPRSRV, and
reserve_mem() now fails with -ENOMEM instead of using it. Is that the
right thing to do?
- Should reserve_mem skip mirrored memory like HugeTLB does, rather
than keep the fallback?
No Cc: stable, since patch 2 relies on 14773e2aa4c5 ("kho: extend
scratch") for room outside bootmem.
Based on next-20261021, as it needs the KHO bootmem rename from
liveupdate-7.4 and touches code changed in memblock for-next.
Tested on x86_64 in QEMU.
Jose A. Perez de Azpillaga (2):
memblock: factor out the KHO bootmem check from
memblock_alloc_hugetlb()
memblock: don't allocate reserve_mem regions from KHO bootmem
mm/memblock.c | 100 ++++++++++++++++++++++++++++++++------------------
1 file changed, 64 insertions(+), 36 deletions(-)
base-commit: 9a482184d910775cf648863148944945b74e2815
--
2.55.0
next reply other threads:[~2026-10-21 21:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 21:10 Jose A. Perez de Azpillaga [this message]
2026-10-21 21:10 ` [RFC PATCH 1/2] memblock: factor out the KHO bootmem check from memblock_alloc_hugetlb() Jose A. Perez de Azpillaga
2026-10-21 21:10 ` [RFC PATCH 2/2] memblock: don't allocate reserve_mem regions from KHO bootmem Jose A. Perez de Azpillaga
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=20261021211058.83483-1-azpijr@gmail.com \
--to=azpijr@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=changyuanl@google.com \
--cc=gpiccoli@igalia.com \
--cc=graf@amazon.com \
--cc=kees@kernel.org \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pasha.tatashin@soleen.com \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=tony.luck@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®