From: Usama Arif <usamaarif642@gmail.com>
To: rppt@kernel.org, Andrew Morton <akpm@linux-foundation.org>
Cc: kas@kernel.org, changyuanl@google.com, graf@amazon.com,
leitao@debian.org, thevlad@meta.com, pratyush@kernel.org,
dave.hansen@linux.intel.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, kernel-team@meta.com,
Usama Arif <usamaarif642@gmail.com>
Subject: [PATCH v2 1/2] mm/memblock: remove CONFIG_MEMBLOCK_KHO_SCRATCH option
Date: Thu, 27 Nov 2025 20:33:19 +0000 [thread overview]
Message-ID: <20251127203724.3177621-2-usamaarif642@gmail.com> (raw)
In-Reply-To: <20251127203724.3177621-1-usamaarif642@gmail.com>
The only defconfig that selects this is CONFIG_KEXEC_HANDOVER.
Replace CONFIG_MEMBLOCK_KHO_SCRATCH with CONFIG_KEXEC_HANDOVER
to simplify code.
No functional change intended.
Suggested-by: Kiryl Shutsemau <kas@kernel.org>
Signed-off-by: Usama Arif <usamaarif642@gmail.com>
---
include/linux/memblock.h | 2 +-
kernel/Kconfig.kexec | 1 -
mm/Kconfig | 4 ----
mm/memblock.c | 4 ++--
4 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 221118b5a16e1..8bd9bcaccceb8 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -611,7 +611,7 @@ static inline void early_memtest(phys_addr_t start, phys_addr_t end) { }
static inline void memtest_report_meminfo(struct seq_file *m) { }
#endif
-#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
+#ifdef CONFIG_KEXEC_HANDOVER
void memblock_set_kho_scratch_only(void);
void memblock_clear_kho_scratch_only(void);
void memmap_init_kho_scratch_pages(void);
diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec
index 54e5810726176..06a7c43652cfd 100644
--- a/kernel/Kconfig.kexec
+++ b/kernel/Kconfig.kexec
@@ -98,7 +98,6 @@ config KEXEC_HANDOVER
bool "kexec handover"
depends on ARCH_SUPPORTS_KEXEC_HANDOVER && ARCH_SUPPORTS_KEXEC_FILE
depends on !DEFERRED_STRUCT_PAGE_INIT
- select MEMBLOCK_KHO_SCRATCH
select KEXEC_FILE
select DEBUG_FS
select LIBFDT
diff --git a/mm/Kconfig b/mm/Kconfig
index bd0ea5454af82..6d6002f57c18f 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -442,10 +442,6 @@ config HAVE_GUP_FAST
depends on MMU
bool
-# Enable memblock support for scratch memory which is needed for kexec handover
-config MEMBLOCK_KHO_SCRATCH
- bool
-
# Don't discard allocated memory used to track "memory" and "reserved" memblocks
# after early boot, so it can still be used to test for validity of memory.
# Also, memblocks are updated with memory hot(un)plug.
diff --git a/mm/memblock.c b/mm/memblock.c
index e23e16618e9b3..8b13d5c28922a 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -112,7 +112,7 @@ unsigned long min_low_pfn;
unsigned long max_pfn;
unsigned long long max_possible_pfn;
-#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
+#ifdef CONFIG_KEXEC_HANDOVER
/* When set to true, only allocate from MEMBLOCK_KHO_SCRATCH ranges */
static bool kho_scratch_only;
#else
@@ -948,7 +948,7 @@ int __init_memblock memblock_physmem_add(phys_addr_t base, phys_addr_t size)
}
#endif
-#ifdef CONFIG_MEMBLOCK_KHO_SCRATCH
+#ifdef CONFIG_KEXEC_HANDOVER
__init void memblock_set_kho_scratch_only(void)
{
kho_scratch_only = true;
--
2.47.3
next prev parent reply other threads:[~2025-11-27 20:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 20:33 [PATCH v2 0/2] mm: only mark/clear KHO scratch memory when needed Usama Arif
2025-11-27 20:33 ` Usama Arif [this message]
2025-11-27 21:23 ` [PATCH v2 1/2] mm/memblock: remove CONFIG_MEMBLOCK_KHO_SCRATCH option Pratyush Yadav
2025-11-28 11:57 ` Kiryl Shutsemau
2025-11-27 20:33 ` [PATCH v2 2/2] mm/memblock: only mark/clear KHO scratch memory when needed Usama Arif
2025-11-27 20:55 ` Andrew Morton
2025-11-27 21:04 ` Usama Arif
2025-11-27 21:30 ` Pratyush Yadav
2025-11-27 21:37 ` Pratyush Yadav
2025-11-28 8:26 ` Mike Rapoport
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=20251127203724.3177621-2-usamaarif642@gmail.com \
--to=usamaarif642@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=changyuanl@google.com \
--cc=dave.hansen@linux.intel.com \
--cc=graf@amazon.com \
--cc=kas@kernel.org \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=pratyush@kernel.org \
--cc=rppt@kernel.org \
--cc=thevlad@meta.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