mm/kconfig: Drop redundant memory hotplug dependencies
Subsystems (2)
PATCH 1/1 mm/kconfig: Drop redundant memory hotplug dependencies
From: Kaitao Cheng <[email protected]>
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.
--- mm/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
mm/Kconfig +1 -3
@@ -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
Signature · 1 line
2.50.1 (Apple Git-155)
Quoted 32 lines · Kaitao Cheng
From: Kaitao Cheng <[email protected]>
MHP_MEMMAP_ON_MEMORYis defined inside theMEMORY_HOTPLUGblock, andMEMORY_HOTPLUGalready depends onSPARSEMEM_VMEMMAP. Keep the explicitMEMORY_HOTPLUGdependency for local readability, but drop the redundantSPARSEMEM_VMEMMAPdependency.
ZONE_DEVICEdepends onMEMORY_HOTREMOVE, which depends onMEMORY_HOTPLUG.MEMORY_HOTPLUGin turn depends onSPARSEMEM_VMEMMAP. Drop the directMEMORY_HOTPLUGandSPARSEMEM_VMEMMAPdependencies fromZONE_DEVICE.This does not change the set of valid configurations.
Signed-off-by Kaitao Cheng <[email protected]>--- mm/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)mm/Kconfig +1
-1@@ -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
mm/Kconfig config ZONE_DMA32 · line 1239
Quoted 7 lines
mm/Kconfig +0
-2@@ -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
I'm planning on merging MEMORY_HOTPLUG and MEMORY_HOTREMOVE soon, but for now that is good enough.
Signature · 3 lines
Cheers, David
Quoted 11 lines · Kaitao Cheng
From: Kaitao Cheng <[email protected]>
MHP_MEMMAP_ON_MEMORYis defined inside theMEMORY_HOTPLUGblock, andMEMORY_HOTPLUGalready depends onSPARSEMEM_VMEMMAP. Keep the explicitMEMORY_HOTPLUGdependency for local readability, but drop the redundantSPARSEMEM_VMEMMAPdependency.
Quoted 7 lines
ZONE_DEVICEdepends onMEMORY_HOTREMOVE, which depends onMEMORY_HOTPLUG.MEMORY_HOTPLUGin turn depends onSPARSEMEM_VMEMMAP. Drop the directMEMORY_HOTPLUGandSPARSEMEM_VMEMMAPdependencies fromZONE_DEVICE.This does not change the set of valid configurations.
Signed-off-by Kaitao Cheng <[email protected]>
Thanks
Quoted 7 lines · Kaitao Cheng
From: Kaitao Cheng <[email protected]>
MHP_MEMMAP_ON_MEMORYis defined inside theMEMORY_HOTPLUGblock, andMEMORY_HOTPLUGalready depends onSPARSEMEM_VMEMMAP. Keep the explicitMEMORY_HOTPLUGdependency for local readability, but drop the redundantSPARSEMEM_VMEMMAPdependency.
Quoted 7 lines
ZONE_DEVICEdepends onMEMORY_HOTREMOVE, which depends onMEMORY_HOTPLUG.MEMORY_HOTPLUGin turn depends onSPARSEMEM_VMEMMAP. Drop the directMEMORY_HOTPLUGandSPARSEMEM_VMEMMAPdependencies fromZONE_DEVICE.This does not change the set of valid configurations.
Signed-off-by Kaitao Cheng <[email protected]>
LGTM, so:
Quoted 28 lines
--- mm/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)mm/Kconfig +1
-4@@ -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 --
Quoted 2 lines
2.50.1 (Apple Git-155)
Cheers, Lorenzo
Hi Kaitao,
Quoted 4 lines · Kaitao Cheng
MHP_MEMMAP_ON_MEMORYis defined inside theMEMORY_HOTPLUGblock, andMEMORY_HOTPLUGalready depends onSPARSEMEM_VMEMMAP. Keep the explicitMEMORY_HOTPLUGdependency for local readability, but drop the redundantSPARSEMEM_VMEMMAPdependency.
I love a good kconfig cleanup, but why keep both the 'if MEMORY_HOTPLUG..endif' and the 'depends on MEMORY_HOTPLUG'?
The "local readability" could be achieved with a comment if keeping the 'if..endif'.
And if we don't want the comment and would prefer the explicit 'depends on', then why not remove the 'if..endif'?
- Julian Braha