Skip to contentSkip to conversation

mm/kconfig: Drop redundant memory hotplug dependencies

PATCH Applied Kaitao Cheng 5 participants 5 messages Jul 7 – Jul 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index 04fe5171bb8c..ff29f770d10a 100644
@@ -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)
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Kaitao Cheng

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 -1
index 04fe5171bb8c..ff29f770d10a 100644
@@ -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
Acked-by on v1 1/1
#2 lore raw
In reply to Kaitao Cheng
Quoted 11 lines · Kaitao Cheng

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.

Quoted 7 lines

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.

Thanks

reviewer Reviewed-by on v1 1/1
#3 lore raw
In reply to Kaitao Cheng
Quoted 7 lines · Kaitao Cheng

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.

Quoted 7 lines

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.

LGTM, so:

Quoted 28 lines
---
 mm/Kconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
mm/Kconfig +1 -4
index 04fe5171bb8c..ff29f770d10a 100644
@@ -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

#4 lore raw
In reply to Kaitao Cheng

Hi Kaitao,

Quoted 4 lines · Kaitao Cheng

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.

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