Proposal to realize hot-add *several sections one time*
Subsystems (2)
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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 4 lines · Zhang Zhen
Hi,
Now we can hot-add memory by
Quoted 9 lines
% echo
start_address_of_new_memory>/sys/devices/system/memory/probeThen, [
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.
Quoted 7 lines
% echo
start_address_of_new_memorycount_of_sections>/sys/devices/system/memory/probeThen, [
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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 1/1 mm, hotplug: probe interface is available on several platforms
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.
--- Documentation/memory-hotplug.txt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
Documentation/memory-hotplug.txt +6 -9
@@ -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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [patch] mm, hotplug: probe interface is available on several platforms
Documentation/memory-hotplug.txt If memory device is found, memory hotplug code will be called. · line 217
Quoted 3 lines · David Rientjes
Documentation/memory-hotplug.txt +3
-0+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.
Quoted 28 lines · David Rientjes
Quoted 4 lines · Zhang Zhen
Hi,
Now we can hot-add memory by
Quoted 9 lines
% echo
start_address_of_new_memory>/sys/devices/system/memory/probeThen, [
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 believeDocumentation/memory-hotplug.txtthat suggests this is only for powerpc, x86 and sh allow this interface as well.Quoted 7 lines
% echo
start_address_of_new_memorycount_of_sections>/sys/devices/system/memory/probeThen, [
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.
Quoted 7 lines
The problem is knowing how much memory is being onlined so that you can definitively determine what
count_of_sectionsshould be. The number of pages per memory section depends onPAGE_SIZEandSECTION_SIZE_BITSwhich differ depending on the architectures that support this interface. So if you supportcount_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!
Quoted 1 line
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 15 lines · Zhang Zhen
Quoted 8 lines
Quoted 7 lines
% echo
start_address_of_new_memorycount_of_sections>/sys/devices/system/memory/probeThen, [
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.
Quoted 7 lines
The problem is knowing how much memory is being onlined so that you can definitively determine what
count_of_sectionsshould be. The number of pages per memory section depends onPAGE_SIZEandSECTION_SIZE_BITSwhich differ depending on the architectures that support this interface. So if you supportcount_of_sections, it would return errno even though you have onlined some sections.
Quoted 4 lines
Hum, sorry.
My expression is not right. The count of sections one time hot-added depends onsections_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.
Quoted 10 lines
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_memorycount_of_blocks>/sys/devices/system/memory/probeThen, [
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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 48 lines · David Rientjes
Quoted 15 lines · Zhang Zhen
Quoted 8 lines
Quoted 7 lines
% echo
start_address_of_new_memorycount_of_sections>/sys/devices/system/memory/probeThen, [
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.
Quoted 7 lines
The problem is knowing how much memory is being onlined so that you can definitively determine what
count_of_sectionsshould be. The number of pages per memory section depends onPAGE_SIZEandSECTION_SIZE_BITSwhich differ depending on the architectures that support this interface. So if you supportcount_of_sections, it would return errno even though you have onlined some sections.Quoted 4 lines
Hum, sorry.
My expression is not right. The count of sections one time hot-added depends onsections_per_block.Ok, so you know specifically what
sections_per_blockis for your platform so you know exactly how many sections need to be added.Quoted 10 lines
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_memorycount_of_blocks>/sys/devices/system/memory/probeThen, [
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
"echo0x10000000>/sys/devices/system/memory/probe" fails, the section starting at address0x10000000failed to be onlined for the reason specified by errno. If we follow your suggestion to specify how many sections to online, if
"echo '0x1000000016' >/sys/devices/system/memory/probe" fails, eight sections could have been successfully onlined at address0x10000000and 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.
Quoted 3 lines
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.
Quoted 8 lines
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>