All of lore.kernel.org
 help / color / mirror / Atom feed
* Proposal to realize hot-add *several sections one time*
@ 2014-06-11  9:12 ` Zhang Zhen
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang Zhen @ 2014-06-11  9:12 UTC (permalink / raw)
  To: gregkh, laijs, sjenning; +Cc: linux-kernel, linux-mm, Wang Nan

Hi,

Now we can hot-add memory by

% echo start_address_of_new_memory > /sys/devices/system/memory/probe

Then, [start_address_of_new_memory, start_address_of_new_memory +
memory_block_size] memory range is hot-added.

But we can only hot-add *one section one time* by this way.
Whether we can add an argument on behalf of the count of the sections to add ?
So we can can hot-add *several sections one time*. Just like:

% echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe

Then, [start_address_of_new_memory, start_address_of_new_memory +
count_of_sections * memory_block_size] memory range is hot-added.

If this proposal is reasonable, i will send a patch to realize it.

Any suggestions ?

Best regards.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Proposal to realize hot-add *several sections one time*
@ 2014-06-11  9:12 ` Zhang Zhen
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang Zhen @ 2014-06-11  9:12 UTC (permalink / raw)
  To: gregkh, laijs, sjenning; +Cc: linux-kernel, linux-mm, Wang Nan

Hi,

Now we can hot-add memory by

% echo start_address_of_new_memory > /sys/devices/system/memory/probe

Then, [start_address_of_new_memory, start_address_of_new_memory +
memory_block_size] memory range is hot-added.

But we can only hot-add *one section one time* by this way.
Whether we can add an argument on behalf of the count of the sections to add ?
So we can can hot-add *several sections one time*. Just like:

% echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe

Then, [start_address_of_new_memory, start_address_of_new_memory +
count_of_sections * memory_block_size] memory range is hot-added.

If this proposal is reasonable, i will send a patch to realize it.

Any suggestions ?

Best regards.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
  2014-06-11  9:12 ` Zhang Zhen
@ 2014-06-11 22:08   ` David Rientjes
  -1 siblings, 0 replies; 14+ messages in thread
From: David Rientjes @ 2014-06-11 22:08 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On Wed, 11 Jun 2014, Zhang Zhen wrote:

> Hi,
> 
> Now we can hot-add memory by
> 
> % echo start_address_of_new_memory > /sys/devices/system/memory/probe
> 
> Then, [start_address_of_new_memory, start_address_of_new_memory +
> memory_block_size] memory range is hot-added.
> 
> But we can only hot-add *one section one time* by this way.
> Whether we can add an argument on behalf of the count of the sections to add ?
> So we can can hot-add *several sections one time*. Just like:
> 

Not necessarily true, it depends on sections_per_block.  Don't believe 
Documentation/memory-hotplug.txt that suggests this is only for powerpc, 
x86 and sh allow this interface as well.

> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
> 
> Then, [start_address_of_new_memory, start_address_of_new_memory +
> count_of_sections * memory_block_size] memory range is hot-added.
> 
> If this proposal is reasonable, i will send a patch to realize it.
> 

The problem is knowing how much memory is being onlined so that you can 
definitively determine what count_of_sections should be.  The number of 
pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
differ depending on the architectures that support this interface.  So if 
you support count_of_sections, it would return errno even though you have 
onlined some sections.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
@ 2014-06-11 22:08   ` David Rientjes
  0 siblings, 0 replies; 14+ messages in thread
From: David Rientjes @ 2014-06-11 22:08 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On Wed, 11 Jun 2014, Zhang Zhen wrote:

> Hi,
> 
> Now we can hot-add memory by
> 
> % echo start_address_of_new_memory > /sys/devices/system/memory/probe
> 
> Then, [start_address_of_new_memory, start_address_of_new_memory +
> memory_block_size] memory range is hot-added.
> 
> But we can only hot-add *one section one time* by this way.
> Whether we can add an argument on behalf of the count of the sections to add ?
> So we can can hot-add *several sections one time*. Just like:
> 

Not necessarily true, it depends on sections_per_block.  Don't believe 
Documentation/memory-hotplug.txt that suggests this is only for powerpc, 
x86 and sh allow this interface as well.

> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
> 
> Then, [start_address_of_new_memory, start_address_of_new_memory +
> count_of_sections * memory_block_size] memory range is hot-added.
> 
> If this proposal is reasonable, i will send a patch to realize it.
> 

The problem is knowing how much memory is being onlined so that you can 
definitively determine what count_of_sections should be.  The number of 
pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
differ depending on the architectures that support this interface.  So if 
you support count_of_sections, it would return errno even though you have 
onlined some sections.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [patch] mm, hotplug: probe interface is available on several platforms
  2014-06-11 22:08   ` David Rientjes
@ 2014-06-11 22:15     ` David Rientjes
  -1 siblings, 0 replies; 14+ messages in thread
From: David Rientjes @ 2014-06-11 22:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Dave Hansen, Zhang Zhen, Greg Kroah-Hartman, laijs, sjenning,
	linux-kernel, linux-mm, Wang Nan

Documentation/memory-hotplug.txt incorrectly states that the memory driver 
"probe" interface is only supported on powerpc and is vague about its 
application on x86.  Clarify the platforms that make this interface 
available if memory hotplug is enabled.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 Documentation/memory-hotplug.txt | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt
--- a/Documentation/memory-hotplug.txt
+++ b/Documentation/memory-hotplug.txt
@@ -209,15 +209,12 @@ If memory device is found, memory hotplug code will be called.
 
 4.2 Notify memory hot-add event by hand
 ------------
-On powerpc, the firmware does not notify a memory hotplug event to the kernel.
-Therefore, "probe" interface is supported to notify the event to the kernel.
-This interface depends on CONFIG_ARCH_MEMORY_PROBE.
-
-CONFIG_ARCH_MEMORY_PROBE is supported on powerpc only. On x86, this config
-option is disabled by default since ACPI notifies a memory hotplug event to
-the kernel, which performs its hotplug operation as the result. Please
-enable this option if you need the "probe" interface for testing purposes
-on x86.
+On some architectures, the firmware may not notify the kernel of a memory
+hotplug event.  Therefore, the memory "probe" interface is supported to
+explicitly notify the kernel.  This interface depends on
+CONFIG_ARCH_MEMORY_PROBE and can be configured on powerpc, sh, and x86
+if hotplug is supported, although for x86 this should be handled by ACPI
+notification.
 
 Probe interface is located at
 /sys/devices/system/memory/probe

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [patch] mm, hotplug: probe interface is available on several platforms
@ 2014-06-11 22:15     ` David Rientjes
  0 siblings, 0 replies; 14+ messages in thread
From: David Rientjes @ 2014-06-11 22:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Dave Hansen, Zhang Zhen, Greg Kroah-Hartman, laijs, sjenning,
	linux-kernel, linux-mm, Wang Nan

Documentation/memory-hotplug.txt incorrectly states that the memory driver 
"probe" interface is only supported on powerpc and is vague about its 
application on x86.  Clarify the platforms that make this interface 
available if memory hotplug is enabled.

Signed-off-by: David Rientjes <rientjes@google.com>
---
 Documentation/memory-hotplug.txt | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt
--- a/Documentation/memory-hotplug.txt
+++ b/Documentation/memory-hotplug.txt
@@ -209,15 +209,12 @@ If memory device is found, memory hotplug code will be called.
 
 4.2 Notify memory hot-add event by hand
 ------------
-On powerpc, the firmware does not notify a memory hotplug event to the kernel.
-Therefore, "probe" interface is supported to notify the event to the kernel.
-This interface depends on CONFIG_ARCH_MEMORY_PROBE.
-
-CONFIG_ARCH_MEMORY_PROBE is supported on powerpc only. On x86, this config
-option is disabled by default since ACPI notifies a memory hotplug event to
-the kernel, which performs its hotplug operation as the result. Please
-enable this option if you need the "probe" interface for testing purposes
-on x86.
+On some architectures, the firmware may not notify the kernel of a memory
+hotplug event.  Therefore, the memory "probe" interface is supported to
+explicitly notify the kernel.  This interface depends on
+CONFIG_ARCH_MEMORY_PROBE and can be configured on powerpc, sh, and x86
+if hotplug is supported, although for x86 this should be handled by ACPI
+notification.
 
 Probe interface is located at
 /sys/devices/system/memory/probe

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [patch] mm, hotplug: probe interface is available on several platforms
  2014-06-11 22:15     ` David Rientjes
@ 2014-06-11 22:22       ` Dave Hansen
  -1 siblings, 0 replies; 14+ messages in thread
From: Dave Hansen @ 2014-06-11 22:22 UTC (permalink / raw)
  To: David Rientjes, Andrew Morton
  Cc: Zhang Zhen, Greg Kroah-Hartman, laijs, sjenning, linux-kernel,
	linux-mm, Wang Nan

On 06/11/2014 03:15 PM, David Rientjes wrote:
> +CONFIG_ARCH_MEMORY_PROBE and can be configured on powerpc, sh, and x86
> +if hotplug is supported, although for x86 this should be handled by ACPI
> +notification.

Looks like a good change, in general.

My only nit is that this implies that all hotplug on x86 is ACPI-based,
which isn't true.  Xen, at least, has an extension to its ballooning
that does hotplugs without ACPI.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [patch] mm, hotplug: probe interface is available on several platforms
@ 2014-06-11 22:22       ` Dave Hansen
  0 siblings, 0 replies; 14+ messages in thread
From: Dave Hansen @ 2014-06-11 22:22 UTC (permalink / raw)
  To: David Rientjes, Andrew Morton
  Cc: Zhang Zhen, Greg Kroah-Hartman, laijs, sjenning, linux-kernel,
	linux-mm, Wang Nan

On 06/11/2014 03:15 PM, David Rientjes wrote:
> +CONFIG_ARCH_MEMORY_PROBE and can be configured on powerpc, sh, and x86
> +if hotplug is supported, although for x86 this should be handled by ACPI
> +notification.

Looks like a good change, in general.

My only nit is that this implies that all hotplug on x86 is ACPI-based,
which isn't true.  Xen, at least, has an extension to its ballooning
that does hotplugs without ACPI.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
  2014-06-11 22:08   ` David Rientjes
@ 2014-06-12  2:41     ` Zhang Zhen
  -1 siblings, 0 replies; 14+ messages in thread
From: Zhang Zhen @ 2014-06-12  2:41 UTC (permalink / raw)
  To: David Rientjes; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On 2014/6/12 6:08, David Rientjes wrote:
> On Wed, 11 Jun 2014, Zhang Zhen wrote:
> 
>> Hi,
>>
>> Now we can hot-add memory by
>>
>> % echo start_address_of_new_memory > /sys/devices/system/memory/probe
>>
>> Then, [start_address_of_new_memory, start_address_of_new_memory +
>> memory_block_size] memory range is hot-added.
>>
>> But we can only hot-add *one section one time* by this way.
>> Whether we can add an argument on behalf of the count of the sections to add ?
>> So we can can hot-add *several sections one time*. Just like:
>>
> 
> Not necessarily true, it depends on sections_per_block.  Don't believe 
> Documentation/memory-hotplug.txt that suggests this is only for powerpc, 
> x86 and sh allow this interface as well.
> 
>> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
>>
>> Then, [start_address_of_new_memory, start_address_of_new_memory +
>> count_of_sections * memory_block_size] memory range is hot-added.
>>
>> If this proposal is reasonable, i will send a patch to realize it.
>>
> 
> The problem is knowing how much memory is being onlined so that you can 
> definitively determine what count_of_sections should be.  The number of 
> pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
> differ depending on the architectures that support this interface.  So if 
> you support count_of_sections, it would return errno even though you have 
> onlined some sections.
> 
Hum, sorry.
My expression is not right. The count of sections one time hot-added
depends on sections_per_block.

Now we are porting the memory-hotplug to arm.
But we can only hot-add *fixed number of sections one time* on particular architecture.

Whether we can add an argument on behalf of the count of the blocks to add ?

% echo start_address_of_new_memory count_of_blocks > /sys/devices/system/memory/probe

Then, [start_address_of_new_memory, start_address_of_new_memory + count_of_blocks * memory_block_size]
memory range is hot-added.

So user don't need execute several times of echo when they want to hot add multi-block size memory.

Any comments are welcome.

Best regards!
> 



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
@ 2014-06-12  2:41     ` Zhang Zhen
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang Zhen @ 2014-06-12  2:41 UTC (permalink / raw)
  To: David Rientjes; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On 2014/6/12 6:08, David Rientjes wrote:
> On Wed, 11 Jun 2014, Zhang Zhen wrote:
> 
>> Hi,
>>
>> Now we can hot-add memory by
>>
>> % echo start_address_of_new_memory > /sys/devices/system/memory/probe
>>
>> Then, [start_address_of_new_memory, start_address_of_new_memory +
>> memory_block_size] memory range is hot-added.
>>
>> But we can only hot-add *one section one time* by this way.
>> Whether we can add an argument on behalf of the count of the sections to add ?
>> So we can can hot-add *several sections one time*. Just like:
>>
> 
> Not necessarily true, it depends on sections_per_block.  Don't believe 
> Documentation/memory-hotplug.txt that suggests this is only for powerpc, 
> x86 and sh allow this interface as well.
> 
>> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
>>
>> Then, [start_address_of_new_memory, start_address_of_new_memory +
>> count_of_sections * memory_block_size] memory range is hot-added.
>>
>> If this proposal is reasonable, i will send a patch to realize it.
>>
> 
> The problem is knowing how much memory is being onlined so that you can 
> definitively determine what count_of_sections should be.  The number of 
> pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
> differ depending on the architectures that support this interface.  So if 
> you support count_of_sections, it would return errno even though you have 
> onlined some sections.
> 
Hum, sorry.
My expression is not right. The count of sections one time hot-added
depends on sections_per_block.

Now we are porting the memory-hotplug to arm.
But we can only hot-add *fixed number of sections one time* on particular architecture.

Whether we can add an argument on behalf of the count of the blocks to add ?

% echo start_address_of_new_memory count_of_blocks > /sys/devices/system/memory/probe

Then, [start_address_of_new_memory, start_address_of_new_memory + count_of_blocks * memory_block_size]
memory range is hot-added.

So user don't need execute several times of echo when they want to hot add multi-block size memory.

Any comments are welcome.

Best regards!
> 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
  2014-06-12  2:41     ` Zhang Zhen
@ 2014-06-12  7:07       ` David Rientjes
  -1 siblings, 0 replies; 14+ messages in thread
From: David Rientjes @ 2014-06-12  7:07 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On Thu, 12 Jun 2014, Zhang Zhen wrote:

> >> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
> >>
> >> Then, [start_address_of_new_memory, start_address_of_new_memory +
> >> count_of_sections * memory_block_size] memory range is hot-added.
> >>
> >> If this proposal is reasonable, i will send a patch to realize it.
> >>
> > 
> > The problem is knowing how much memory is being onlined so that you can 
> > definitively determine what count_of_sections should be.  The number of 
> > pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
> > differ depending on the architectures that support this interface.  So if 
> > you support count_of_sections, it would return errno even though you have 
> > onlined some sections.
> > 
> Hum, sorry.
> My expression is not right. The count of sections one time hot-added
> depends on sections_per_block.
> 

Ok, so you know specifically what sections_per_block is for your platform 
so you know exactly how many sections need to be added.

> Now we are porting the memory-hotplug to arm.
> But we can only hot-add *fixed number of sections one time* on particular architecture.
> 
> Whether we can add an argument on behalf of the count of the blocks to add ?
> 
> % echo start_address_of_new_memory count_of_blocks > /sys/devices/system/memory/probe
> 
> Then, [start_address_of_new_memory, start_address_of_new_memory + count_of_blocks * memory_block_size]
> memory range is hot-added.
> 

As I said, if the above returns errno at some point, it still can result 
in some sections being onlined.  To be clear: if
"echo 0x10000000 > /sys/devices/system/memory/probe" fails, the section 
starting at address 0x10000000 failed to be onlined for the reason 
specified by errno.  If we follow your suggestion to specify how many 
sections to online, if
"echo '0x10000000 16' > /sys/devices/system/memory/probe" fails, eight 
sections could have been successfully onlined at address 0x10000000 and 
then we encountered a failure (perhaps because the next sections were 
already onlined, we get an -EEXIST).  We don't know what we successfully 
onlined.

This could be mitigated, but there would have to be a convincing reason 
that this is better than using the currently functionally in a loop and 
properly handling your error codes.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
@ 2014-06-12  7:07       ` David Rientjes
  0 siblings, 0 replies; 14+ messages in thread
From: David Rientjes @ 2014-06-12  7:07 UTC (permalink / raw)
  To: Zhang Zhen; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On Thu, 12 Jun 2014, Zhang Zhen wrote:

> >> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
> >>
> >> Then, [start_address_of_new_memory, start_address_of_new_memory +
> >> count_of_sections * memory_block_size] memory range is hot-added.
> >>
> >> If this proposal is reasonable, i will send a patch to realize it.
> >>
> > 
> > The problem is knowing how much memory is being onlined so that you can 
> > definitively determine what count_of_sections should be.  The number of 
> > pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
> > differ depending on the architectures that support this interface.  So if 
> > you support count_of_sections, it would return errno even though you have 
> > onlined some sections.
> > 
> Hum, sorry.
> My expression is not right. The count of sections one time hot-added
> depends on sections_per_block.
> 

Ok, so you know specifically what sections_per_block is for your platform 
so you know exactly how many sections need to be added.

> Now we are porting the memory-hotplug to arm.
> But we can only hot-add *fixed number of sections one time* on particular architecture.
> 
> Whether we can add an argument on behalf of the count of the blocks to add ?
> 
> % echo start_address_of_new_memory count_of_blocks > /sys/devices/system/memory/probe
> 
> Then, [start_address_of_new_memory, start_address_of_new_memory + count_of_blocks * memory_block_size]
> memory range is hot-added.
> 

As I said, if the above returns errno at some point, it still can result 
in some sections being onlined.  To be clear: if
"echo 0x10000000 > /sys/devices/system/memory/probe" fails, the section 
starting at address 0x10000000 failed to be onlined for the reason 
specified by errno.  If we follow your suggestion to specify how many 
sections to online, if
"echo '0x10000000 16' > /sys/devices/system/memory/probe" fails, eight 
sections could have been successfully onlined at address 0x10000000 and 
then we encountered a failure (perhaps because the next sections were 
already onlined, we get an -EEXIST).  We don't know what we successfully 
onlined.

This could be mitigated, but there would have to be a convincing reason 
that this is better than using the currently functionally in a loop and 
properly handling your error codes.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
  2014-06-12  7:07       ` David Rientjes
@ 2014-06-13  7:31         ` Zhang Zhen
  -1 siblings, 0 replies; 14+ messages in thread
From: Zhang Zhen @ 2014-06-13  7:31 UTC (permalink / raw)
  To: David Rientjes; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On 2014/6/12 15:07, David Rientjes wrote:
> On Thu, 12 Jun 2014, Zhang Zhen wrote:
> 
>>>> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
>>>>
>>>> Then, [start_address_of_new_memory, start_address_of_new_memory +
>>>> count_of_sections * memory_block_size] memory range is hot-added.
>>>>
>>>> If this proposal is reasonable, i will send a patch to realize it.
>>>>
>>>
>>> The problem is knowing how much memory is being onlined so that you can 
>>> definitively determine what count_of_sections should be.  The number of 
>>> pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
>>> differ depending on the architectures that support this interface.  So if 
>>> you support count_of_sections, it would return errno even though you have 
>>> onlined some sections.
>>>
>> Hum, sorry.
>> My expression is not right. The count of sections one time hot-added
>> depends on sections_per_block.
>>
> 
> Ok, so you know specifically what sections_per_block is for your platform 
> so you know exactly how many sections need to be added.
> 
>> Now we are porting the memory-hotplug to arm.
>> But we can only hot-add *fixed number of sections one time* on particular architecture.
>>
>> Whether we can add an argument on behalf of the count of the blocks to add ?
>>
>> % echo start_address_of_new_memory count_of_blocks > /sys/devices/system/memory/probe
>>
>> Then, [start_address_of_new_memory, start_address_of_new_memory + count_of_blocks * memory_block_size]
>> memory range is hot-added.
>>
> 
> As I said, if the above returns errno at some point, it still can result 
> in some sections being onlined.  To be clear: if
> "echo 0x10000000 > /sys/devices/system/memory/probe" fails, the section 
> starting at address 0x10000000 failed to be onlined for the reason 
> specified by errno.  If we follow your suggestion to specify how many 
> sections to online, if
> "echo '0x10000000 16' > /sys/devices/system/memory/probe" fails, eight 
> sections could have been successfully onlined at address 0x10000000 and 
> then we encountered a failure (perhaps because the next sections were 
> already onlined, we get an -EEXIST).  We don't know what we successfully 
> onlined.
> 
> This could be mitigated, but there would have to be a convincing reason 
> that this is better than using the currently functionally in a loop and 
> properly handling your error codes.

Hi David,

I think you are right.

We had better to use the currently functionally in a loop if we need to add
several blocks.
In this way, we can get an errno in time if a block failed to be onlined.

Thanks for your comments. I got it.

> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> 
> 



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Proposal to realize hot-add *several sections one time*
@ 2014-06-13  7:31         ` Zhang Zhen
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang Zhen @ 2014-06-13  7:31 UTC (permalink / raw)
  To: David Rientjes; +Cc: gregkh, laijs, sjenning, linux-kernel, linux-mm, Wang Nan

On 2014/6/12 15:07, David Rientjes wrote:
> On Thu, 12 Jun 2014, Zhang Zhen wrote:
> 
>>>> % echo start_address_of_new_memory count_of_sections > /sys/devices/system/memory/probe
>>>>
>>>> Then, [start_address_of_new_memory, start_address_of_new_memory +
>>>> count_of_sections * memory_block_size] memory range is hot-added.
>>>>
>>>> If this proposal is reasonable, i will send a patch to realize it.
>>>>
>>>
>>> The problem is knowing how much memory is being onlined so that you can 
>>> definitively determine what count_of_sections should be.  The number of 
>>> pages per memory section depends on PAGE_SIZE and SECTION_SIZE_BITS which 
>>> differ depending on the architectures that support this interface.  So if 
>>> you support count_of_sections, it would return errno even though you have 
>>> onlined some sections.
>>>
>> Hum, sorry.
>> My expression is not right. The count of sections one time hot-added
>> depends on sections_per_block.
>>
> 
> Ok, so you know specifically what sections_per_block is for your platform 
> so you know exactly how many sections need to be added.
> 
>> Now we are porting the memory-hotplug to arm.
>> But we can only hot-add *fixed number of sections one time* on particular architecture.
>>
>> Whether we can add an argument on behalf of the count of the blocks to add ?
>>
>> % echo start_address_of_new_memory count_of_blocks > /sys/devices/system/memory/probe
>>
>> Then, [start_address_of_new_memory, start_address_of_new_memory + count_of_blocks * memory_block_size]
>> memory range is hot-added.
>>
> 
> As I said, if the above returns errno at some point, it still can result 
> in some sections being onlined.  To be clear: if
> "echo 0x10000000 > /sys/devices/system/memory/probe" fails, the section 
> starting at address 0x10000000 failed to be onlined for the reason 
> specified by errno.  If we follow your suggestion to specify how many 
> sections to online, if
> "echo '0x10000000 16' > /sys/devices/system/memory/probe" fails, eight 
> sections could have been successfully onlined at address 0x10000000 and 
> then we encountered a failure (perhaps because the next sections were 
> already onlined, we get an -EEXIST).  We don't know what we successfully 
> onlined.
> 
> This could be mitigated, but there would have to be a convincing reason 
> that this is better than using the currently functionally in a loop and 
> properly handling your error codes.

Hi David,

I think you are right.

We had better to use the currently functionally in a loop if we need to add
several blocks.
In this way, we can get an errno in time if a block failed to be onlined.

Thanks for your comments. I got it.

> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
> 
> 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2014-06-13  7:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11  9:12 Proposal to realize hot-add *several sections one time* Zhang Zhen
2014-06-11  9:12 ` Zhang Zhen
2014-06-11 22:08 ` David Rientjes
2014-06-11 22:08   ` David Rientjes
2014-06-11 22:15   ` [patch] mm, hotplug: probe interface is available on several platforms David Rientjes
2014-06-11 22:15     ` David Rientjes
2014-06-11 22:22     ` Dave Hansen
2014-06-11 22:22       ` Dave Hansen
2014-06-12  2:41   ` Proposal to realize hot-add *several sections one time* Zhang Zhen
2014-06-12  2:41     ` Zhang Zhen
2014-06-12  7:07     ` David Rientjes
2014-06-12  7:07       ` David Rientjes
2014-06-13  7:31       ` Zhang Zhen
2014-06-13  7:31         ` Zhang Zhen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.