Re: [PATCH -mm] mm, memory-hotpulg: Rename movablenode boot option to movable_node

2013-10-01 Thread Zhang Yanfei
Hello Ingo,

On 10/01/2013 01:46 PM, Ingo Molnar wrote:
> 
> * Zhang Yanfei  wrote:
> 
>> @@ -153,11 +153,18 @@ config MOVABLE_NODE
>>  help
>>Allow a node to have only movable memory.  Pages used by the kernel,
>>such as direct mapping pages cannot be migrated.  So the corresponding
>> +  memory device cannot be hotplugged.  This option allows the following
>> +  two things:
>> +  - When the system is booting, node full of hotpluggable memory can
>> +  be arranged to have only movable memory so that the whole node can
>> +  be hotplugged. (need movable_node boot option specified).
> 
> So this is _exactly_ what I complained about earlier: why is the 
> movable_node boot option needed to get that extra functionality? It's 
> clearly not just a drop-in substitute to CONFIG_MOVABLE_NODE but extends 
> its functionality, right?

Generally speaking, CONFIG_MOVABLE_NODE is used to allow a node to have
only movable memory. Firstly, we didn't support the functionality to support
boot-time configuration. That said, before this patchset, we only support
later hot-add node to have only movable memory but any node that is dectected
at boot-time cannot. So here is movable_node option, to protect the kernel
from using hotpluggable memory at boot-time and if a node is full of 
hotpluggable
memory, this node is arranged to have only movable memory and can be hot-removed
after the system is up.

> 
> Boot options are _very_ poor user interface. If you don't want to enable 
> it by default then turn this sub-functionality into 
> CONFIG_MOVABLE_NODE_AUTO and keep it default-off - but don't pretend that 
> this is only about CONFIG_MOVABLE_NODE alone - it isnt: as described above 
> the 'movable_node' is needed for the full functionality to be available!

As explained above, we need the boot option to only disable boot-time
memory-hotplug configuration not the whole MOVABLE_NODE functionality.

Thanks

-- 
Thanks.
Zhang Yanfei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm] mm, memory-hotpulg: Rename movablenode boot option to movable_node

2013-10-01 Thread Zhang Yanfei
Hello Ingo,

On 10/01/2013 01:46 PM, Ingo Molnar wrote:
 
 * Zhang Yanfei zhangyanfei@gmail.com wrote:
 
 @@ -153,11 +153,18 @@ config MOVABLE_NODE
  help
Allow a node to have only movable memory.  Pages used by the kernel,
such as direct mapping pages cannot be migrated.  So the corresponding
 +  memory device cannot be hotplugged.  This option allows the following
 +  two things:
 +  - When the system is booting, node full of hotpluggable memory can
 +  be arranged to have only movable memory so that the whole node can
 +  be hotplugged. (need movable_node boot option specified).
 
 So this is _exactly_ what I complained about earlier: why is the 
 movable_node boot option needed to get that extra functionality? It's 
 clearly not just a drop-in substitute to CONFIG_MOVABLE_NODE but extends 
 its functionality, right?

Generally speaking, CONFIG_MOVABLE_NODE is used to allow a node to have
only movable memory. Firstly, we didn't support the functionality to support
boot-time configuration. That said, before this patchset, we only support
later hot-add node to have only movable memory but any node that is dectected
at boot-time cannot. So here is movable_node option, to protect the kernel
from using hotpluggable memory at boot-time and if a node is full of 
hotpluggable
memory, this node is arranged to have only movable memory and can be hot-removed
after the system is up.

 
 Boot options are _very_ poor user interface. If you don't want to enable 
 it by default then turn this sub-functionality into 
 CONFIG_MOVABLE_NODE_AUTO and keep it default-off - but don't pretend that 
 this is only about CONFIG_MOVABLE_NODE alone - it isnt: as described above 
 the 'movable_node' is needed for the full functionality to be available!

As explained above, we need the boot option to only disable boot-time
memory-hotplug configuration not the whole MOVABLE_NODE functionality.

Thanks

-- 
Thanks.
Zhang Yanfei
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH -mm] mm, memory-hotpulg: Rename movablenode boot option to movable_node

2013-09-30 Thread Ingo Molnar

* Zhang Yanfei  wrote:

> @@ -153,11 +153,18 @@ config MOVABLE_NODE
>   help
> Allow a node to have only movable memory.  Pages used by the kernel,
> such as direct mapping pages cannot be migrated.  So the corresponding
> +   memory device cannot be hotplugged.  This option allows the following
> +   two things:
> +   - When the system is booting, node full of hotpluggable memory can
> +   be arranged to have only movable memory so that the whole node can
> +   be hotplugged. (need movable_node boot option specified).

So this is _exactly_ what I complained about earlier: why is the 
movable_node boot option needed to get that extra functionality? It's 
clearly not just a drop-in substitute to CONFIG_MOVABLE_NODE but extends 
its functionality, right?

Boot options are _very_ poor user interface. If you don't want to enable 
it by default then turn this sub-functionality into 
CONFIG_MOVABLE_NODE_AUTO and keep it default-off - but don't pretend that 
this is only about CONFIG_MOVABLE_NODE alone - it isnt: as described above 
the 'movable_node' is needed for the full functionality to be available!

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -mm] mm, memory-hotpulg: Rename movablenode boot option to movable_node

2013-09-30 Thread Zhang Yanfei
From: Zhang Yanfei 

Since we already has config MOVABLE_NODE, and the boot option
movablenode is introduced as the boot-time switch to disable
the effects of CONFIG_MOVABLE_NODE=y when the system is booting.

So rename boot option movablenode to movable_node to match the
config MOVABLE_NODE. And also updates the description of MOVABLE_NODE
in mm/Kconfig and the description of movable_node in kernel doc.

Suggested-by: Ingo Molnar 
Signed-off-by: Zhang Yanfei 
---
 Documentation/kernel-parameters.txt |   16 ++--
 mm/Kconfig  |   17 -
 mm/memory_hotplug.c |6 +++---
 3 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index a87e17e..953a533 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1773,20 +1773,8 @@ bytes respectively. Such letter suffixes can also be 
entirely omitted.
that the amount of memory usable for all allocations
is not too small.
 
-   movablenode [KNL,X86] This parameter enables/disables the
-   kernel to arrange hotpluggable memory ranges recorded
-   in ACPI SRAT(System Resource Affinity Table) as
-   ZONE_MOVABLE. And these memory can be hot-removed when
-   the system is up.
-   By specifying this option, all the hotpluggable memory
-   will be in ZONE_MOVABLE, which the kernel cannot use.
-   This will cause NUMA performance down. For users who
-   care about NUMA performance, just don't use it.
-   If all the memory ranges in the system are hotpluggable,
-   then the ones used by the kernel at early time, such as
-   kernel code and data segments, initrd file and so on,
-   won't be set as ZONE_MOVABLE, and won't be hotpluggable.
-   Otherwise the kernel won't have enough memory to boot.
+   movable_node[KNL,X86] Boot-time switch to disable the effects
+   of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details.
 
MTD_Partition=  [MTD]
Format: ,,,
diff --git a/mm/Kconfig b/mm/Kconfig
index ff6e820..8d4ebb0 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -153,11 +153,18 @@ config MOVABLE_NODE
help
  Allow a node to have only movable memory.  Pages used by the kernel,
  such as direct mapping pages cannot be migrated.  So the corresponding
- memory device cannot be hotplugged.  This option allows users to
- online all the memory of a node as movable memory so that the whole
- node can be hotplugged.  Users who don't use the memory hotplug
- feature are fine with this option on since they don't online memory
- as movable.
+ memory device cannot be hotplugged.  This option allows the following
+ two things:
+ - When the system is booting, node full of hotpluggable memory can
+ be arranged to have only movable memory so that the whole node can
+ be hotplugged. (need movable_node boot option specified).
+ - After the system is up, the option allows users to online all the
+ memory of a node as movable memory so that the whole node can be
+ hotplugged.
+
+ Users who don't use the memory hotplug feature are fine with this
+ option on since they don't specify movable_node boot option or they
+ don't online memory as movable.
 
  Say Y here if you want to hotplug a whole node.
  Say N here if you want kernel to use memory on all nodes evenly.
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index b468f77..5e2aed9 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1424,7 +1424,7 @@ static bool can_offline_normal(struct zone *zone, 
unsigned long nr_pages)
 }
 #endif /* CONFIG_MOVABLE_NODE */
 
-static int __init cmdline_parse_movablenode(char *p)
+static int __init cmdline_parse_movable_node(char *p)
 {
 #ifdef CONFIG_MOVABLE_NODE
/*
@@ -1448,11 +1448,11 @@ static int __init cmdline_parse_movablenode(char *p)
 */
memblock_set_bottom_up(true);
 #else
-   pr_warn("movablenode option not supported");
+   pr_warn("movable_node option not supported");
 #endif
return 0;
 }
-early_param("movablenode", cmdline_parse_movablenode);
+early_param("movable_node", cmdline_parse_movable_node);
 
 /* check which state of node_states will be changed when offline memory */
 static void node_states_check_changes_offline(unsigned long nr_pages,
-- 
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  

[PATCH -mm] mm, memory-hotpulg: Rename movablenode boot option to movable_node

2013-09-30 Thread Zhang Yanfei
From: Zhang Yanfei zhangyan...@cn.fujitsu.com

Since we already has config MOVABLE_NODE, and the boot option
movablenode is introduced as the boot-time switch to disable
the effects of CONFIG_MOVABLE_NODE=y when the system is booting.

So rename boot option movablenode to movable_node to match the
config MOVABLE_NODE. And also updates the description of MOVABLE_NODE
in mm/Kconfig and the description of movable_node in kernel doc.

Suggested-by: Ingo Molnar mi...@kernel.org
Signed-off-by: Zhang Yanfei zhangyan...@cn.fujitsu.com
---
 Documentation/kernel-parameters.txt |   16 ++--
 mm/Kconfig  |   17 -
 mm/memory_hotplug.c |6 +++---
 3 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index a87e17e..953a533 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1773,20 +1773,8 @@ bytes respectively. Such letter suffixes can also be 
entirely omitted.
that the amount of memory usable for all allocations
is not too small.
 
-   movablenode [KNL,X86] This parameter enables/disables the
-   kernel to arrange hotpluggable memory ranges recorded
-   in ACPI SRAT(System Resource Affinity Table) as
-   ZONE_MOVABLE. And these memory can be hot-removed when
-   the system is up.
-   By specifying this option, all the hotpluggable memory
-   will be in ZONE_MOVABLE, which the kernel cannot use.
-   This will cause NUMA performance down. For users who
-   care about NUMA performance, just don't use it.
-   If all the memory ranges in the system are hotpluggable,
-   then the ones used by the kernel at early time, such as
-   kernel code and data segments, initrd file and so on,
-   won't be set as ZONE_MOVABLE, and won't be hotpluggable.
-   Otherwise the kernel won't have enough memory to boot.
+   movable_node[KNL,X86] Boot-time switch to disable the effects
+   of CONFIG_MOVABLE_NODE=y. See mm/Kconfig for details.
 
MTD_Partition=  [MTD]
Format: name,region-number,size,offset
diff --git a/mm/Kconfig b/mm/Kconfig
index ff6e820..8d4ebb0 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -153,11 +153,18 @@ config MOVABLE_NODE
help
  Allow a node to have only movable memory.  Pages used by the kernel,
  such as direct mapping pages cannot be migrated.  So the corresponding
- memory device cannot be hotplugged.  This option allows users to
- online all the memory of a node as movable memory so that the whole
- node can be hotplugged.  Users who don't use the memory hotplug
- feature are fine with this option on since they don't online memory
- as movable.
+ memory device cannot be hotplugged.  This option allows the following
+ two things:
+ - When the system is booting, node full of hotpluggable memory can
+ be arranged to have only movable memory so that the whole node can
+ be hotplugged. (need movable_node boot option specified).
+ - After the system is up, the option allows users to online all the
+ memory of a node as movable memory so that the whole node can be
+ hotplugged.
+
+ Users who don't use the memory hotplug feature are fine with this
+ option on since they don't specify movable_node boot option or they
+ don't online memory as movable.
 
  Say Y here if you want to hotplug a whole node.
  Say N here if you want kernel to use memory on all nodes evenly.
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index b468f77..5e2aed9 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1424,7 +1424,7 @@ static bool can_offline_normal(struct zone *zone, 
unsigned long nr_pages)
 }
 #endif /* CONFIG_MOVABLE_NODE */
 
-static int __init cmdline_parse_movablenode(char *p)
+static int __init cmdline_parse_movable_node(char *p)
 {
 #ifdef CONFIG_MOVABLE_NODE
/*
@@ -1448,11 +1448,11 @@ static int __init cmdline_parse_movablenode(char *p)
 */
memblock_set_bottom_up(true);
 #else
-   pr_warn(movablenode option not supported);
+   pr_warn(movable_node option not supported);
 #endif
return 0;
 }
-early_param(movablenode, cmdline_parse_movablenode);
+early_param(movable_node, cmdline_parse_movable_node);
 
 /* check which state of node_states will be changed when offline memory */
 static void node_states_check_changes_offline(unsigned long nr_pages,
-- 
1.7.1
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the 

Re: [PATCH -mm] mm, memory-hotpulg: Rename movablenode boot option to movable_node

2013-09-30 Thread Ingo Molnar

* Zhang Yanfei zhangyanfei@gmail.com wrote:

 @@ -153,11 +153,18 @@ config MOVABLE_NODE
   help
 Allow a node to have only movable memory.  Pages used by the kernel,
 such as direct mapping pages cannot be migrated.  So the corresponding
 +   memory device cannot be hotplugged.  This option allows the following
 +   two things:
 +   - When the system is booting, node full of hotpluggable memory can
 +   be arranged to have only movable memory so that the whole node can
 +   be hotplugged. (need movable_node boot option specified).

So this is _exactly_ what I complained about earlier: why is the 
movable_node boot option needed to get that extra functionality? It's 
clearly not just a drop-in substitute to CONFIG_MOVABLE_NODE but extends 
its functionality, right?

Boot options are _very_ poor user interface. If you don't want to enable 
it by default then turn this sub-functionality into 
CONFIG_MOVABLE_NODE_AUTO and keep it default-off - but don't pretend that 
this is only about CONFIG_MOVABLE_NODE alone - it isnt: as described above 
the 'movable_node' is needed for the full functionality to be available!

Thanks,

Ingo
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/