Re: [PATCH 06/14] mm/bootmem_info: remove handling for !CONFIG_SPARSEMEM_VMEMMAP

Mike Rapoport
2026-03-18T08:15:11Z

On Tue, Mar 17, 2026 at 05:56:44PM +0100, David Hildenbrand (Arm) wrote:
> It is not immediately obvious that CONFIG_HAVE_BOOTMEM_INFO_NODE is

Would be nice to make it more obvious, e.g. something like the patch below.

> only selected from CONFIG_MEMORY_HOTREMOVE, which itself depends on
> CONFIG_MEMORY_HOTPLUG that ... depends on CONFIG_SPARSEMEM_VMEMMAP.
>
> Let's remove the !CONFIG_SPARSEMEM_VMEMMAP leftovers.
>
> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>

Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
> mm/bootmem_info.c | 37 -------------------------------------
> 1 file changed, 37 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 102ddbd4298e..261abc3e1957 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1841,4 +1841,18 @@ config ARCH_WANTS_PRE_LINK_VMLINUX
config ARCH_HAS_CPU_ATTACK_VECTORS
bool

+#
+# Only be set on architectures that have completely implemented memory hotplug
+# feature. If you are not sure, don't touch it.
+#
+config HAVE_BOOTMEM_INFO_NODE
+ def_bool n
+
+config ARCH_ENABLE_MEMORY_HOTPLUG
+ bool
+
+config ARCH_ENABLE_MEMORY_HOTREMOVE
+ bool
+
+
endmenu
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index ad7a2fe63a2a..2d6f348d11f7 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -127,6 +127,7 @@ config PPC
select ARCH_DMA_DEFAULT_COHERENT if !NOT_COHERENT_CACHE
select ARCH_ENABLE_MEMORY_HOTPLUG
select ARCH_ENABLE_MEMORY_HOTREMOVE
+ select HAVE_BOOTMEM_INFO_NODE if MEMORY_HOTREMOVE
select ARCH_HAS_COPY_MC if PPC64
select ARCH_HAS_CURRENT_STACK_POINTER
select ARCH_HAS_DEBUG_VIRTUAL
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e2df1b147184..ef2d2044f1a9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -70,6 +70,7 @@ config X86
select ARCH_ENABLE_HUGEPAGE_MIGRATION if X86_64 && HUGETLB_PAGE && MIGRATION
select ARCH_ENABLE_MEMORY_HOTPLUG if X86_64
select ARCH_ENABLE_MEMORY_HOTREMOVE if MEMORY_HOTPLUG
+ select HAVE_BOOTMEM_INFO_NODE if MEMORY_HOTREMOVE
select ARCH_ENABLE_SPLIT_PMD_PTLOCK if (PGTABLE_LEVELS > 2) && (X86_64 || X86_PAE)
select ARCH_ENABLE_THP_MIGRATION if X86_64 && TRANSPARENT_HUGEPAGE
select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
diff --git a/mm/Kconfig b/mm/Kconfig
index ebd8ea353687..a371df4f8da4 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -455,19 +455,6 @@ config EXCLUSIVE_SYSTEM_RAM
def_bool y
depends on !DEVMEM || STRICT_DEVMEM

-#
-# Only be set on architectures that have completely implemented memory hotplug
-# feature. If you are not sure, don't touch it.
-#
-config HAVE_BOOTMEM_INFO_NODE
- def_bool n
-
-config ARCH_ENABLE_MEMORY_HOTPLUG
- bool
-
-config ARCH_ENABLE_MEMORY_HOTREMOVE
- bool
-
# eventually, we can have this option just 'select SPARSEMEM'
menuconfig MEMORY_HOTPLUG
bool "Memory hotplug"
@@ -539,7 +526,6 @@ endchoice

config MEMORY_HOTREMOVE
bool "Allow for memory hot remove"
- select HAVE_BOOTMEM_INFO_NODE if (X86_64 || PPC64)
depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
depends on MIGRATION

--
Sincerely yours,
Mike.