* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-07 23:44 ` [PATCH v6 4/4] of/fdt: mark hotpluggable memory Reza Arbab
@ 2016-11-08 1:59 ` kbuild test robot
2016-11-08 19:59 ` Reza Arbab
2016-11-09 18:12 ` Rob Herring
` (4 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: kbuild test robot @ 2016-11-08 1:59 UTC (permalink / raw)
To: Reza Arbab
Cc: kbuild-all, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, Andrew Morton, Rob Herring, Frank Rowand,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Stewart Smith,
devicetree, linux-kernel, linux-mm, Alistair Popple,
Aneesh Kumar K.V, Bharata B Rao, Nathan Fontenot, linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1582 bytes --]
Hi Reza,
[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.9-rc4 next-20161028]
[cannot apply to mmotm/master]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Reza-Arbab/enable-movable-nodes-on-non-x86-configs/20161108-081711
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: tile-allmodconfig (attached as .config)
compiler: tilegx-linux-gcc (GCC) 4.6.2
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=tile
All errors (new ones prefixed by >>):
drivers/of/fdt.c: In function 'early_init_dt_scan_memory':
>> drivers/of/fdt.c:1064:3: error: implicit declaration of function 'memblock_mark_hotplug'
cc1: some warnings being treated as errors
vim +/memblock_mark_hotplug +1064 drivers/of/fdt.c
1058 continue;
1059 pr_debug(" - %llx , %llx\n", (unsigned long long)base,
1060 (unsigned long long)size);
1061
1062 early_init_dt_add_memory_arch(base, size);
1063
> 1064 if (hotpluggable && memblock_mark_hotplug(base, size))
1065 pr_warn("failed to mark hotplug range 0x%llx - 0x%llx\n",
1066 base, base + size);
1067 }
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45509 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-08 1:59 ` kbuild test robot
@ 2016-11-08 19:59 ` Reza Arbab
0 siblings, 0 replies; 17+ messages in thread
From: Reza Arbab @ 2016-11-08 19:59 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, Andrew Morton, Rob Herring, Frank Rowand,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Stewart Smith,
devicetree, linux-kernel, linux-mm, Alistair Popple,
Aneesh Kumar K.V, Bharata B Rao, Nathan Fontenot, linuxppc-dev
On Tue, Nov 08, 2016 at 09:59:26AM +0800, kbuild test robot wrote:
>All errors (new ones prefixed by >>):
>
> drivers/of/fdt.c: In function 'early_init_dt_scan_memory':
>>> drivers/of/fdt.c:1064:3: error: implicit declaration of function 'memblock_mark_hotplug'
> cc1: some warnings being treated as errors
>
>vim +/memblock_mark_hotplug +1064 drivers/of/fdt.c
>
> 1058 continue;
> 1059 pr_debug(" - %llx , %llx\n", (unsigned long long)base,
> 1060 (unsigned long long)size);
> 1061
> 1062 early_init_dt_add_memory_arch(base, size);
> 1063
>> 1064 if (hotpluggable && memblock_mark_hotplug(base, size))
> 1065 pr_warn("failed to mark hotplug range 0x%llx - 0x%llx\n",
> 1066 base, base + size);
> 1067 }
Ah, I need to adjust for !CONFIG_HAVE_MEMBLOCK. Will correct in v7.
--
Reza Arbab
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-07 23:44 ` [PATCH v6 4/4] of/fdt: mark hotpluggable memory Reza Arbab
2016-11-08 1:59 ` kbuild test robot
@ 2016-11-09 18:12 ` Rob Herring
2016-11-09 20:15 ` Reza Arbab
2016-11-10 0:56 ` Balbir Singh
` (3 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Rob Herring @ 2016-11-09 18:12 UTC (permalink / raw)
To: Reza Arbab
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Andrew Morton, Frank Rowand, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, linuxppc-dev, linux-mm@kvack.org,
devicetree@vger.kernel.org, Bharata B Rao, Nathan Fontenot,
Stewart Smith, Alistair Popple, Balbir Singh, Aneesh Kumar K.V,
linux-kernel@vger.kernel.org
On Mon, Nov 7, 2016 at 5:44 PM, Reza Arbab <arbab@linux.vnet.ibm.com> wrote:
> When movable nodes are enabled, any node containing only hotpluggable
> memory is made movable at boot time.
>
> On x86, hotpluggable memory is discovered by parsing the ACPI SRAT,
> making corresponding calls to memblock_mark_hotplug().
>
> If we introduce a dt property to describe memory as hotpluggable,
> configs supporting early fdt may then also do this marking and use
> movable nodes.
>
> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
> ---
> drivers/of/fdt.c | 6 ++++++
> mm/Kconfig | 2 +-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index c89d5d2..2cf1d66 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1015,6 +1015,7 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
> const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
> const __be32 *reg, *endp;
> int l;
> + bool hotpluggable;
>
> /* We are scanning "memory" nodes only */
> if (type == NULL) {
> @@ -1034,6 +1035,7 @@ int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
> return 0;
>
> endp = reg + (l / sizeof(__be32));
> + hotpluggable = of_get_flat_dt_prop(node, "linux,hotpluggable", NULL);
Memory being hotpluggable doesn't seem like a linux property to me.
I'd drop the linux prefix. Also, this needs to be documented.
Rob
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-09 18:12 ` Rob Herring
@ 2016-11-09 20:15 ` Reza Arbab
0 siblings, 0 replies; 17+ messages in thread
From: Reza Arbab @ 2016-11-09 20:15 UTC (permalink / raw)
To: Rob Herring
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Andrew Morton, Frank Rowand, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, linuxppc-dev, linux-mm@kvack.org,
devicetree@vger.kernel.org, Bharata B Rao, Nathan Fontenot,
Stewart Smith, Alistair Popple, Balbir Singh, Aneesh Kumar K.V,
linux-kernel@vger.kernel.org
On Wed, Nov 09, 2016 at 12:12:55PM -0600, Rob Herring wrote:
>On Mon, Nov 7, 2016 at 5:44 PM, Reza Arbab <arbab@linux.vnet.ibm.com> wrote:
>> + hotpluggable = of_get_flat_dt_prop(node, "linux,hotpluggable", NULL);
>
>Memory being hotpluggable doesn't seem like a linux property to me.
>I'd drop the linux prefix. Also, this needs to be documented.
Sure, that makes sense. I'll do both in v7.
--
Reza Arbab
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-07 23:44 ` [PATCH v6 4/4] of/fdt: mark hotpluggable memory Reza Arbab
2016-11-08 1:59 ` kbuild test robot
2016-11-09 18:12 ` Rob Herring
@ 2016-11-10 0:56 ` Balbir Singh
2016-11-10 20:52 ` Reza Arbab
2016-11-11 1:17 ` Balbir Singh
` (2 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Balbir Singh @ 2016-11-10 0:56 UTC (permalink / raw)
To: Reza Arbab, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, Andrew Morton, Rob Herring, Frank Rowand,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin
Cc: linuxppc-dev, linux-mm, devicetree, Bharata B Rao,
Nathan Fontenot, Stewart Smith, Alistair Popple, Aneesh Kumar K.V,
linux-kernel
On 08/11/16 10:44, Reza Arbab wrote:
> When movable nodes are enabled, any node containing only hotpluggable
> memory is made movable at boot time.
>
> On x86, hotpluggable memory is discovered by parsing the ACPI SRAT,
> making corresponding calls to memblock_mark_hotplug().
>
> If we introduce a dt property to describe memory as hotpluggable,
> configs supporting early fdt may then also do this marking and use
> movable nodes.
This looks much better, like the other comments pointed out
We need documentation around the changes. One quick question
Have you tested this across all combinations of skiboot/kexec/SLOF boots?
Balbir Singh.
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-10 0:56 ` Balbir Singh
@ 2016-11-10 20:52 ` Reza Arbab
0 siblings, 0 replies; 17+ messages in thread
From: Reza Arbab @ 2016-11-10 20:52 UTC (permalink / raw)
To: Balbir Singh
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Andrew Morton, Rob Herring, Frank Rowand, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, linuxppc-dev, linux-mm, devicetree,
Bharata B Rao, Nathan Fontenot, Stewart Smith, Alistair Popple,
Aneesh Kumar K.V, linux-kernel
On Thu, Nov 10, 2016 at 11:56:02AM +1100, Balbir Singh wrote:
>Have you tested this across all combinations of skiboot/kexec/SLOF
>boots?
I've tested it under qemu/grub, simics/skiboot, and via kexec.
--
Reza Arbab
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-07 23:44 ` [PATCH v6 4/4] of/fdt: mark hotpluggable memory Reza Arbab
` (2 preceding siblings ...)
2016-11-10 0:56 ` Balbir Singh
@ 2016-11-11 1:17 ` Balbir Singh
2016-11-14 11:59 ` Michael Ellerman
2016-12-25 9:02 ` Heinrich Schuchardt
5 siblings, 0 replies; 17+ messages in thread
From: Balbir Singh @ 2016-11-11 1:17 UTC (permalink / raw)
To: Reza Arbab, Michael Ellerman, Benjamin Herrenschmidt,
Paul Mackerras, Andrew Morton, Rob Herring, Frank Rowand,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin
Cc: linuxppc-dev, linux-mm, devicetree, Bharata B Rao,
Nathan Fontenot, Stewart Smith, Alistair Popple, Aneesh Kumar K.V,
linux-kernel
On 08/11/16 10:44, Reza Arbab wrote:
> When movable nodes are enabled, any node containing only hotpluggable
> memory is made movable at boot time.
>
> On x86, hotpluggable memory is discovered by parsing the ACPI SRAT,
> making corresponding calls to memblock_mark_hotplug().
>
> If we introduce a dt property to describe memory as hotpluggable,
> configs supporting early fdt may then also do this marking and use
> movable nodes.
>
> Signed-off-by: Reza Arbab <arbab@linux.vnet.ibm.com>
> ---
Tested-by: Balbir Singh <bsingharora@gmail.com>
I tested this with a custom device tree and it worked quite well for me.
It also means that the guest and bare-metal have two different mechanisms
of marking something as hotpluggable. But given that your patch enables
all architectures using OF, it might be worth it.
Balbir Singh.
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-07 23:44 ` [PATCH v6 4/4] of/fdt: mark hotpluggable memory Reza Arbab
` (3 preceding siblings ...)
2016-11-11 1:17 ` Balbir Singh
@ 2016-11-14 11:59 ` Michael Ellerman
2016-11-14 19:34 ` Reza Arbab
2016-12-25 9:02 ` Heinrich Schuchardt
5 siblings, 1 reply; 17+ messages in thread
From: Michael Ellerman @ 2016-11-14 11:59 UTC (permalink / raw)
To: Reza Arbab, Benjamin Herrenschmidt, Paul Mackerras, Andrew Morton,
Rob Herring, Frank Rowand, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin
Cc: linuxppc-dev, linux-mm, devicetree, Bharata B Rao,
Nathan Fontenot, Stewart Smith, Alistair Popple, Balbir Singh,
Aneesh Kumar K.V, linux-kernel
Reza Arbab <arbab@linux.vnet.ibm.com> writes:
> When movable nodes are enabled, any node containing only hotpluggable
> memory is made movable at boot time.
>
> On x86, hotpluggable memory is discovered by parsing the ACPI SRAT,
> making corresponding calls to memblock_mark_hotplug().
>
> If we introduce a dt property to describe memory as hotpluggable,
> configs supporting early fdt may then also do this marking and use
> movable nodes.
So I'm not opposed to this, but it is a little vague.
What does the "hotpluggable" property really mean?
Is it just a hint to the operating system? (which may or may not be
Linux).
Or is it a direction, "this memory must be able to be hotunplugged"?
I think you're intending the former, ie. a hint, which is probably OK.
But it needs to be documented clearly.
cheers
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-14 11:59 ` Michael Ellerman
@ 2016-11-14 19:34 ` Reza Arbab
0 siblings, 0 replies; 17+ messages in thread
From: Reza Arbab @ 2016-11-14 19:34 UTC (permalink / raw)
To: Michael Ellerman
Cc: Benjamin Herrenschmidt, Paul Mackerras, Andrew Morton,
Rob Herring, Frank Rowand, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, linuxppc-dev, linux-mm, devicetree, Bharata B Rao,
Nathan Fontenot, Stewart Smith, Alistair Popple, Balbir Singh,
Aneesh Kumar K.V, linux-kernel
On Mon, Nov 14, 2016 at 10:59:43PM +1100, Michael Ellerman wrote:
>So I'm not opposed to this, but it is a little vague.
>
>What does the "hotpluggable" property really mean?
>
>Is it just a hint to the operating system? (which may or may not be
>Linux).
>
>Or is it a direction, "this memory must be able to be hotunplugged"?
>
>I think you're intending the former, ie. a hint, which is probably OK.
>But it needs to be documented clearly.
Yes, you've got it right. It's just a hint, not a mandate.
I'm about to send v7 which adds a description of "hotpluggable" in the
documentation. Hopefully I've explained it well enough there.
--
Reza Arbab
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-11-07 23:44 ` [PATCH v6 4/4] of/fdt: mark hotpluggable memory Reza Arbab
` (4 preceding siblings ...)
2016-11-14 11:59 ` Michael Ellerman
@ 2016-12-25 9:02 ` Heinrich Schuchardt
2016-12-27 0:09 ` Frank Rowand
5 siblings, 1 reply; 17+ messages in thread
From: Heinrich Schuchardt @ 2016-12-25 9:02 UTC (permalink / raw)
To: Reza Arbab
Cc: Balbir Singh, Aneesh Kumar K . V, H . Peter Anvin,
Alistair Popple, Benjamin Herrenschmidt, Bharata B Rao,
Frank Rowand, Ingo Molnar, Michael Ellerman, Nathan Fontenot,
Paul Mackerras, Rob Herring, Stewart Smith, Thomas Gleixner,
Andrew Morton, devicetree, linux-kernel, linux-mm,
Heinrich Schuchardt
The patch adds a new property "linux,hotpluggable" to memory nodes of the
device tree.
memory@0 {
reg = <0x0 0x01000000 0x0 0x7f000000>;
linux,hotpluggable;
}
Memory areas marked by this property can later be disabled using the hotplugging
API. Especially for virtual machines this is a very useful capability.
Unfortunately the notation chosen does not fit well with the concept of
devicetree overlays which allow to change the devicetree during runtime.
I suggest to use the following notation
memory@0 {
compatible = "linux,hotpluggable-memory";
reg = <0x0 0x01000000 0x0 0x7f000000>;
status = "disabled";
}
This will allow us to write a device driver that can react to changes of the
devicetree made via devicetree overlays.
This driver could react to the change of the status between "okay" and
"disabled" and update the memory status accordingly.
Further we could use devicetree overlays to provide additional hotpluggable
memory.
The referenced patch has already been pulled for 4.10. But I hope it is not
too late for this design change.
Best regards
Heinrich Schuchardt
--
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] 17+ messages in thread
* Re: [PATCH v6 4/4] of/fdt: mark hotpluggable memory
2016-12-25 9:02 ` Heinrich Schuchardt
@ 2016-12-27 0:09 ` Frank Rowand
0 siblings, 0 replies; 17+ messages in thread
From: Frank Rowand @ 2016-12-27 0:09 UTC (permalink / raw)
To: Heinrich Schuchardt, Reza Arbab
Cc: Balbir Singh, Aneesh Kumar K . V, H . Peter Anvin,
Alistair Popple, Benjamin Herrenschmidt, Bharata B Rao,
Ingo Molnar, Michael Ellerman, Nathan Fontenot, Paul Mackerras,
Rob Herring, Stewart Smith, Thomas Gleixner, Andrew Morton,
devicetree, linux-kernel, linux-mm
On 12/25/16 01:02, Heinrich Schuchardt wrote:
> The patch adds a new property "linux,hotpluggable" to memory nodes of the
> device tree.
>
> memory@0 {
> reg = <0x0 0x01000000 0x0 0x7f000000>;
> linux,hotpluggable;
> }
>
> Memory areas marked by this property can later be disabled using the hotplugging
> API. Especially for virtual machines this is a very useful capability.
>
> Unfortunately the notation chosen does not fit well with the concept of
> devicetree overlays which allow to change the devicetree during runtime.
Why would one want to change the hot pluggable memory node via an overlay?
In other words, what is missing from the hot pluggable memory paradigm
that instead requires overlays?
If something is missing from the hot pluggable memory code, then it seems
to me that it should be added to that code instead of hacking around it
by using device tree overlays.
-Frank
>
> I suggest to use the following notation
>
> memory@0 {
> compatible = "linux,hotpluggable-memory";
> reg = <0x0 0x01000000 0x0 0x7f000000>;
> status = "disabled";
> }
>
> This will allow us to write a device driver that can react to changes of the
> devicetree made via devicetree overlays.
>
> This driver could react to the change of the status between "okay" and
> "disabled" and update the memory status accordingly.
>
> Further we could use devicetree overlays to provide additional hotpluggable
> memory.
>
> The referenced patch has already been pulled for 4.10. But I hope it is not
> too late for this design change.
>
> Best regards
>
> Heinrich Schuchardt
>
--
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] 17+ messages in thread