Re: [PATCH] mm/kconfig: Drop redundant memory hotplug dependencies
From: Lorenzo Stoakes
Date: Tue Jul 07 2026 - 07:16:15 EST
On Tue, Jul 07, 2026 at 05:03:31PM +0800, Kaitao Cheng wrote:
> From: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
>
> MHP_MEMMAP_ON_MEMORY is defined inside the MEMORY_HOTPLUG block, and
> MEMORY_HOTPLUG already depends on SPARSEMEM_VMEMMAP. Keep the explicit
> MEMORY_HOTPLUG dependency for local readability, but drop the redundant
> SPARSEMEM_VMEMMAP dependency.
>
> ZONE_DEVICE depends on MEMORY_HOTREMOVE, which depends on MEMORY_HOTPLUG.
> MEMORY_HOTPLUG in turn depends on SPARSEMEM_VMEMMAP. Drop the direct
> MEMORY_HOTPLUG and SPARSEMEM_VMEMMAP dependencies from ZONE_DEVICE.
>
> This does not change the set of valid configurations.
>
> Signed-off-by: Kaitao Cheng <chengkaitao@xxxxxxxxxx>
LGTM, so:
Reviewed-by: Lorenzo Stoakes <ljs@xxxxxxxxxx>
> ---
> mm/Kconfig | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/Kconfig b/mm/Kconfig
> index 04fe5171bb8c..ff29f770d10a 100644
> --- a/mm/Kconfig
> +++ b/mm/Kconfig
> @@ -596,7 +596,7 @@ config MEMORY_HOTREMOVE
>
> config MHP_MEMMAP_ON_MEMORY
> def_bool y
> - depends on MEMORY_HOTPLUG && SPARSEMEM_VMEMMAP
> + depends on MEMORY_HOTPLUG
> depends on ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
>
> endif # MEMORY_HOTPLUG
> @@ -1235,9 +1235,7 @@ config ZONE_DMA32
>
> config ZONE_DEVICE
> bool "Device memory (pmem, HMM, etc...) hotplug support"
> - depends on MEMORY_HOTPLUG
> depends on MEMORY_HOTREMOVE
> - depends on SPARSEMEM_VMEMMAP
> select XARRAY_MULTI
>
> help
> --
> 2.50.1 (Apple Git-155)
>
Cheers, Lorenzo