[1/6] arm64/mm: Enable sysfs based memory hot add interface
diff mbox series

Message ID 1554265806-11501-2-git-send-email-anshuman.khandual@arm.com
State New
Headers show
Series
  • arm64/mm: Enable memory hot remove and ZONE_DEVICE
Related show

Commit Message

Anshuman Khandual April 3, 2019, 4:30 a.m. UTC
Sysfs memory probe interface (/sys/devices/system/memory/probe) can accept
starting physical address of an entire memory block to be hot added into
the kernel. This is in addition to the existing ACPI based interface. This
just enables it with the required config CONFIG_ARCH_MEMORY_PROBE.

Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/arm64/Kconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

David Hildenbrand April 3, 2019, 8:20 a.m. UTC | #1
On 03.04.19 06:30, Anshuman Khandual wrote:
> Sysfs memory probe interface (/sys/devices/system/memory/probe) can accept
> starting physical address of an entire memory block to be hot added into
> the kernel. This is in addition to the existing ACPI based interface. This
> just enables it with the required config CONFIG_ARCH_MEMORY_PROBE.
> 

We recently discussed that the similar interface for removal should
rather be moved to a debug/test module

I wonder if we should try to do the same for the sysfs probing
interface. Rather try to get rid of it than open the doors for more users.

> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
>  arch/arm64/Kconfig | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 7e34b9e..a2418fb 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -266,6 +266,15 @@ config HAVE_GENERIC_GUP
>  config ARCH_ENABLE_MEMORY_HOTPLUG
>  	def_bool y
>  
> +config ARCH_MEMORY_PROBE
> +	bool "Enable /sys/devices/system/memory/probe interface"
> +	depends on MEMORY_HOTPLUG
> +	help
> +	  This option enables a sysfs /sys/devices/system/memory/probe
> +	  interface for testing. See Documentation/memory-hotplug.txt
> +	  for more information. If you are unsure how to answer this
> +	  question, answer N.
> +
>  config SMP
>  	def_bool y
>  
>
Robin Murphy April 3, 2019, 1:12 p.m. UTC | #2
On 03/04/2019 09:20, David Hildenbrand wrote:
> On 03.04.19 06:30, Anshuman Khandual wrote:
>> Sysfs memory probe interface (/sys/devices/system/memory/probe) can accept
>> starting physical address of an entire memory block to be hot added into
>> the kernel. This is in addition to the existing ACPI based interface. This
>> just enables it with the required config CONFIG_ARCH_MEMORY_PROBE.
>>
> 
> We recently discussed that the similar interface for removal should
> rather be moved to a debug/test module
> 
> I wonder if we should try to do the same for the sysfs probing
> interface. Rather try to get rid of it than open the doors for more users.

Agreed - if this option even exists in a released kernel, there's a risk 
that distros will turn it on for the sake of it, and at that point arm64 
is stuck carrying the same ABI baggage as well.

If users turn up in future with a desperate and unavoidable need for the 
legacy half-an-API on arm64, we can always reconsider adding it at that 
point. It was very much deliberate that my original hot-add support did 
not include a patch like this one.

Robin.

>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>> ---
>>   arch/arm64/Kconfig | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>>
>> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
>> index 7e34b9e..a2418fb 100644
>> --- a/arch/arm64/Kconfig
>> +++ b/arch/arm64/Kconfig
>> @@ -266,6 +266,15 @@ config HAVE_GENERIC_GUP
>>   config ARCH_ENABLE_MEMORY_HOTPLUG
>>   	def_bool y
>>   
>> +config ARCH_MEMORY_PROBE
>> +	bool "Enable /sys/devices/system/memory/probe interface"
>> +	depends on MEMORY_HOTPLUG
>> +	help
>> +	  This option enables a sysfs /sys/devices/system/memory/probe
>> +	  interface for testing. See Documentation/memory-hotplug.txt
>> +	  for more information. If you are unsure how to answer this
>> +	  question, answer N.
>> +
>>   config SMP
>>   	def_bool y
>>   
>>
> 
>
Anshuman Khandual April 4, 2019, 5:21 a.m. UTC | #3
On 04/03/2019 06:42 PM, Robin Murphy wrote:
> On 03/04/2019 09:20, David Hildenbrand wrote:
>> On 03.04.19 06:30, Anshuman Khandual wrote:
>>> Sysfs memory probe interface (/sys/devices/system/memory/probe) can accept
>>> starting physical address of an entire memory block to be hot added into
>>> the kernel. This is in addition to the existing ACPI based interface. This
>>> just enables it with the required config CONFIG_ARCH_MEMORY_PROBE.
>>>
>>
>> We recently discussed that the similar interface for removal should
>> rather be moved to a debug/test module
>>
>> I wonder if we should try to do the same for the sysfs probing
>> interface. Rather try to get rid of it than open the doors for more users.
> 
> Agreed - if this option even exists in a released kernel, there's a risk that distros will turn it on for the sake of it, and at that point arm64 is stuck carrying the same ABI baggage as well.

True. Only if we really dont like that interface.

> 
> If users turn up in future with a desperate and unavoidable need for the legacy half-an-API on arm64, we can always reconsider adding it at that point. It was very much deliberate that my original hot-add support did not include a patch like this one.

Sure. Will drop this one next time around.
Anshuman Khandual April 4, 2019, 5:25 a.m. UTC | #4
On 04/03/2019 01:50 PM, David Hildenbrand wrote:
> On 03.04.19 06:30, Anshuman Khandual wrote:
>> Sysfs memory probe interface (/sys/devices/system/memory/probe) can accept
>> starting physical address of an entire memory block to be hot added into
>> the kernel. This is in addition to the existing ACPI based interface. This
>> just enables it with the required config CONFIG_ARCH_MEMORY_PROBE.
>>
> We recently discussed that the similar interface for removal should
> rather be moved to a debug/test module.

Can we maintain such a debug/test module mainline and enable it when required. Or
can have both add and remove interface at /sys/kernel/debug/ just for testing
purpose.

> 
> I wonder if we should try to do the same for the sysfs probing
> interface. Rather try to get rid of it than open the doors for more users.
> 

I understand your concern. Will drop this patch.
David Hildenbrand April 4, 2019, 8:49 a.m. UTC | #5
On 04.04.19 07:25, Anshuman Khandual wrote:
> 
> 
> On 04/03/2019 01:50 PM, David Hildenbrand wrote:
>> On 03.04.19 06:30, Anshuman Khandual wrote:
>>> Sysfs memory probe interface (/sys/devices/system/memory/probe) can accept
>>> starting physical address of an entire memory block to be hot added into
>>> the kernel. This is in addition to the existing ACPI based interface. This
>>> just enables it with the required config CONFIG_ARCH_MEMORY_PROBE.
>>>
>> We recently discussed that the similar interface for removal should
>> rather be moved to a debug/test module.
> 
> Can we maintain such a debug/test module mainline and enable it when required. Or
> can have both add and remove interface at /sys/kernel/debug/ just for testing
> purpose.

I assume we could put such a module into mainline. It could span up an
interface in debugfs.

Patch
diff mbox series

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 7e34b9e..a2418fb 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -266,6 +266,15 @@  config HAVE_GENERIC_GUP
 config ARCH_ENABLE_MEMORY_HOTPLUG
 	def_bool y
 
+config ARCH_MEMORY_PROBE
+	bool "Enable /sys/devices/system/memory/probe interface"
+	depends on MEMORY_HOTPLUG
+	help
+	  This option enables a sysfs /sys/devices/system/memory/probe
+	  interface for testing. See Documentation/memory-hotplug.txt
+	  for more information. If you are unsure how to answer this
+	  question, answer N.
+
 config SMP
 	def_bool y