* [PATCH] mm/memory_hotplug: just build zonelist for new added node
@ 2017-06-26 3:58 ` Wei Yang
0 siblings, 0 replies; 12+ messages in thread
From: Wei Yang @ 2017-06-26 3:58 UTC (permalink / raw)
To: akpm, mhocko, vbabka; +Cc: linux-mm, linux-kernel, Wei Yang
In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
zonelists when creating new pgdat" tries to build the correct zonelist for
a new added node, while it is not necessary to rebuild it for already exist
nodes.
In build_zonelists(), it will iterate on nodes with memory. For a new added
node, it will have memory until node_states_set_node() is called in
online_pages().
This patch will avoid to rebuild the zonelists for already exist nodes.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
mm/page_alloc.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 560eafe8234d..fc8181b44fd8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
memset(node_load, 0, sizeof(node_load));
#endif
- if (self && !node_online(self->node_id)) {
+ /* This node is hotadded and no memory preset yet.
+ * So just build zonelists is fine, no need to touch other nodes.
+ */
+ if (self && !node_online(self->node_id))
build_zonelists(self);
- }
-
- for_each_online_node(nid) {
- pg_data_t *pgdat = NODE_DATA(nid);
+ else
+ for_each_online_node(nid) {
+ pg_data_t *pgdat = NODE_DATA(nid);
- build_zonelists(pgdat);
- }
+ build_zonelists(pgdat);
+ }
/*
* Initialize the boot_pagesets that are going to be used
--
2.11.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] mm/memory_hotplug: just build zonelist for new added node
@ 2017-06-26 3:58 ` Wei Yang
0 siblings, 0 replies; 12+ messages in thread
From: Wei Yang @ 2017-06-26 3:58 UTC (permalink / raw)
To: akpm, mhocko, vbabka; +Cc: linux-mm, linux-kernel, Wei Yang
In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
zonelists when creating new pgdat" tries to build the correct zonelist for
a new added node, while it is not necessary to rebuild it for already exist
nodes.
In build_zonelists(), it will iterate on nodes with memory. For a new added
node, it will have memory until node_states_set_node() is called in
online_pages().
This patch will avoid to rebuild the zonelists for already exist nodes.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
mm/page_alloc.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 560eafe8234d..fc8181b44fd8 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
memset(node_load, 0, sizeof(node_load));
#endif
- if (self && !node_online(self->node_id)) {
+ /* This node is hotadded and no memory preset yet.
+ * So just build zonelists is fine, no need to touch other nodes.
+ */
+ if (self && !node_online(self->node_id))
build_zonelists(self);
- }
-
- for_each_online_node(nid) {
- pg_data_t *pgdat = NODE_DATA(nid);
+ else
+ for_each_online_node(nid) {
+ pg_data_t *pgdat = NODE_DATA(nid);
- build_zonelists(pgdat);
- }
+ build_zonelists(pgdat);
+ }
/*
* Initialize the boot_pagesets that are going to be used
--
2.11.0
--
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 related [flat|nested] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
2017-06-26 3:58 ` Wei Yang
@ 2017-06-28 7:06 ` Vlastimil Babka
-1 siblings, 0 replies; 12+ messages in thread
From: Vlastimil Babka @ 2017-06-28 7:06 UTC (permalink / raw)
To: Wei Yang, akpm, mhocko; +Cc: linux-mm, linux-kernel
On 06/26/2017 05:58 AM, Wei Yang wrote:
> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
> zonelists when creating new pgdat" tries to build the correct zonelist for
> a new added node, while it is not necessary to rebuild it for already exist
> nodes.
>
> In build_zonelists(), it will iterate on nodes with memory. For a new added
> node, it will have memory until node_states_set_node() is called in
it will not have memory
right?
> online_pages().
>
> This patch will avoid to rebuild the zonelists for already exist nodes.
>
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Sounds correct, as far as the memory hotplug mess allows.
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Some style nitpicks below:
> ---
> mm/page_alloc.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 560eafe8234d..fc8181b44fd8 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
> memset(node_load, 0, sizeof(node_load));
> #endif
>
> - if (self && !node_online(self->node_id)) {
> + /* This node is hotadded and no memory preset yet.
On multiline comments, the first line should be empty after "/*"
But I see Andrew already fixed that.
> + * So just build zonelists is fine, no need to touch other nodes.
> + */
> + if (self && !node_online(self->node_id))
> build_zonelists(self);
> - }
> -
> - for_each_online_node(nid) {
> - pg_data_t *pgdat = NODE_DATA(nid);
> + else
> + for_each_online_node(nid) {
> + pg_data_t *pgdat = NODE_DATA(nid);
>
> - build_zonelists(pgdat);
> - }
> + build_zonelists(pgdat);
> + }
Personally I would use { } for the else block, and thus leave them also
for the if block, not sure if this is recommended by the style guide though.
> /*
> * Initialize the boot_pagesets that are going to be used
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
@ 2017-06-28 7:06 ` Vlastimil Babka
0 siblings, 0 replies; 12+ messages in thread
From: Vlastimil Babka @ 2017-06-28 7:06 UTC (permalink / raw)
To: Wei Yang, akpm, mhocko; +Cc: linux-mm, linux-kernel
On 06/26/2017 05:58 AM, Wei Yang wrote:
> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
> zonelists when creating new pgdat" tries to build the correct zonelist for
> a new added node, while it is not necessary to rebuild it for already exist
> nodes.
>
> In build_zonelists(), it will iterate on nodes with memory. For a new added
> node, it will have memory until node_states_set_node() is called in
it will not have memory
right?
> online_pages().
>
> This patch will avoid to rebuild the zonelists for already exist nodes.
>
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Sounds correct, as far as the memory hotplug mess allows.
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Some style nitpicks below:
> ---
> mm/page_alloc.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 560eafe8234d..fc8181b44fd8 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
> memset(node_load, 0, sizeof(node_load));
> #endif
>
> - if (self && !node_online(self->node_id)) {
> + /* This node is hotadded and no memory preset yet.
On multiline comments, the first line should be empty after "/*"
But I see Andrew already fixed that.
> + * So just build zonelists is fine, no need to touch other nodes.
> + */
> + if (self && !node_online(self->node_id))
> build_zonelists(self);
> - }
> -
> - for_each_online_node(nid) {
> - pg_data_t *pgdat = NODE_DATA(nid);
> + else
> + for_each_online_node(nid) {
> + pg_data_t *pgdat = NODE_DATA(nid);
>
> - build_zonelists(pgdat);
> - }
> + build_zonelists(pgdat);
> + }
Personally I would use { } for the else block, and thus leave them also
for the if block, not sure if this is recommended by the style guide though.
> /*
> * Initialize the boot_pagesets that are going to be used
>
--
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] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
2017-06-28 7:06 ` Vlastimil Babka
@ 2017-06-28 7:28 ` Wei Yang
-1 siblings, 0 replies; 12+ messages in thread
From: Wei Yang @ 2017-06-28 7:28 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Andrew Morton, Michal Hocko, Linux-MM, Linux Kernel Mailing List
On Wed, Jun 28, 2017 at 3:06 PM, Vlastimil Babka <vbabka@suse.cz> wrote:
> On 06/26/2017 05:58 AM, Wei Yang wrote:
>> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
>> zonelists when creating new pgdat" tries to build the correct zonelist for
>> a new added node, while it is not necessary to rebuild it for already exist
>> nodes.
>>
>> In build_zonelists(), it will iterate on nodes with memory. For a new added
>> node, it will have memory until node_states_set_node() is called in
>
> it will not have memory
>
No memory at this point.
> right?
>
>> online_pages().
>>
>> This patch will avoid to rebuild the zonelists for already exist nodes.
>>
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>
> Sounds correct, as far as the memory hotplug mess allows.
>
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
>
> Some style nitpicks below:
>
>> ---
>> mm/page_alloc.c | 16 +++++++++-------
>> 1 file changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 560eafe8234d..fc8181b44fd8 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
>> memset(node_load, 0, sizeof(node_load));
>> #endif
>>
>> - if (self && !node_online(self->node_id)) {
>> + /* This node is hotadded and no memory preset yet.
>
> On multiline comments, the first line should be empty after "/*"
>
Thanks, I will pay attention next time.
> But I see Andrew already fixed that.
>
>> + * So just build zonelists is fine, no need to touch other nodes.
>> + */
>> + if (self && !node_online(self->node_id))
>> build_zonelists(self);
>> - }
>> -
>> - for_each_online_node(nid) {
>> - pg_data_t *pgdat = NODE_DATA(nid);
>> + else
>> + for_each_online_node(nid) {
>> + pg_data_t *pgdat = NODE_DATA(nid);
>>
>> - build_zonelists(pgdat);
>> - }
>> + build_zonelists(pgdat);
>> + }
>
> Personally I would use { } for the else block, and thus leave them also
> for the if block, not sure if this is recommended by the style guide though.
>
I am not quite sure about this. The checkpatch.py script doesn't complain.
Thanks for your comment again~
>> /*
>> * Initialize the boot_pagesets that are going to be used
>>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
@ 2017-06-28 7:28 ` Wei Yang
0 siblings, 0 replies; 12+ messages in thread
From: Wei Yang @ 2017-06-28 7:28 UTC (permalink / raw)
To: Vlastimil Babka
Cc: Andrew Morton, Michal Hocko, Linux-MM, Linux Kernel Mailing List
On Wed, Jun 28, 2017 at 3:06 PM, Vlastimil Babka <vbabka@suse.cz> wrote:
> On 06/26/2017 05:58 AM, Wei Yang wrote:
>> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
>> zonelists when creating new pgdat" tries to build the correct zonelist for
>> a new added node, while it is not necessary to rebuild it for already exist
>> nodes.
>>
>> In build_zonelists(), it will iterate on nodes with memory. For a new added
>> node, it will have memory until node_states_set_node() is called in
>
> it will not have memory
>
No memory at this point.
> right?
>
>> online_pages().
>>
>> This patch will avoid to rebuild the zonelists for already exist nodes.
>>
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>
> Sounds correct, as far as the memory hotplug mess allows.
>
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
>
> Some style nitpicks below:
>
>> ---
>> mm/page_alloc.c | 16 +++++++++-------
>> 1 file changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 560eafe8234d..fc8181b44fd8 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
>> memset(node_load, 0, sizeof(node_load));
>> #endif
>>
>> - if (self && !node_online(self->node_id)) {
>> + /* This node is hotadded and no memory preset yet.
>
> On multiline comments, the first line should be empty after "/*"
>
Thanks, I will pay attention next time.
> But I see Andrew already fixed that.
>
>> + * So just build zonelists is fine, no need to touch other nodes.
>> + */
>> + if (self && !node_online(self->node_id))
>> build_zonelists(self);
>> - }
>> -
>> - for_each_online_node(nid) {
>> - pg_data_t *pgdat = NODE_DATA(nid);
>> + else
>> + for_each_online_node(nid) {
>> + pg_data_t *pgdat = NODE_DATA(nid);
>>
>> - build_zonelists(pgdat);
>> - }
>> + build_zonelists(pgdat);
>> + }
>
> Personally I would use { } for the else block, and thus leave them also
> for the if block, not sure if this is recommended by the style guide though.
>
I am not quite sure about this. The checkpatch.py script doesn't complain.
Thanks for your comment again~
>> /*
>> * Initialize the boot_pagesets that are going to be used
>>
>
--
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] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
2017-06-26 3:58 ` Wei Yang
@ 2017-06-28 9:23 ` Michal Hocko
-1 siblings, 0 replies; 12+ messages in thread
From: Michal Hocko @ 2017-06-28 9:23 UTC (permalink / raw)
To: Wei Yang; +Cc: akpm, vbabka, linux-mm, linux-kernel
On Mon 26-06-17 11:58:22, Wei Yang wrote:
> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
> zonelists when creating new pgdat" tries to build the correct zonelist for
> a new added node, while it is not necessary to rebuild it for already exist
> nodes.
>
> In build_zonelists(), it will iterate on nodes with memory. For a new added
> node, it will have memory until node_states_set_node() is called in
> online_pages().
>
> This patch will avoid to rebuild the zonelists for already exist nodes.
It is not very clear from the changelog why that actually matters. The
only effect I can see is that other zonelists on other online nodes will
not learn about the currently memory less node. This is a good think
because we do not pointlessly try to allocate from that node.
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/page_alloc.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 560eafe8234d..fc8181b44fd8 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
> memset(node_load, 0, sizeof(node_load));
> #endif
>
> - if (self && !node_online(self->node_id)) {
> + /* This node is hotadded and no memory preset yet.
> + * So just build zonelists is fine, no need to touch other nodes.
> + */
This comment doesn't make much sense to me. What about
/*
* Do not rebuild zonelists on all online nodes if the current
* node is not online yet (it doesn't have any memory) and
* allocating from it is pointless. Still build zonelist for
* self because we need to handle memoryless nodes.
*/
> + if (self && !node_online(self->node_id))
> build_zonelists(self);
> - }
> -
> - for_each_online_node(nid) {
> - pg_data_t *pgdat = NODE_DATA(nid);
> + else
> + for_each_online_node(nid) {
> + pg_data_t *pgdat = NODE_DATA(nid);
>
> - build_zonelists(pgdat);
> - }
> + build_zonelists(pgdat);
> + }
>
> /*
> * Initialize the boot_pagesets that are going to be used
> --
> 2.11.0
>
> --
> 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>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
@ 2017-06-28 9:23 ` Michal Hocko
0 siblings, 0 replies; 12+ messages in thread
From: Michal Hocko @ 2017-06-28 9:23 UTC (permalink / raw)
To: Wei Yang; +Cc: akpm, vbabka, linux-mm, linux-kernel
On Mon 26-06-17 11:58:22, Wei Yang wrote:
> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
> zonelists when creating new pgdat" tries to build the correct zonelist for
> a new added node, while it is not necessary to rebuild it for already exist
> nodes.
>
> In build_zonelists(), it will iterate on nodes with memory. For a new added
> node, it will have memory until node_states_set_node() is called in
> online_pages().
>
> This patch will avoid to rebuild the zonelists for already exist nodes.
It is not very clear from the changelog why that actually matters. The
only effect I can see is that other zonelists on other online nodes will
not learn about the currently memory less node. This is a good think
because we do not pointlessly try to allocate from that node.
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/page_alloc.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 560eafe8234d..fc8181b44fd8 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
> memset(node_load, 0, sizeof(node_load));
> #endif
>
> - if (self && !node_online(self->node_id)) {
> + /* This node is hotadded and no memory preset yet.
> + * So just build zonelists is fine, no need to touch other nodes.
> + */
This comment doesn't make much sense to me. What about
/*
* Do not rebuild zonelists on all online nodes if the current
* node is not online yet (it doesn't have any memory) and
* allocating from it is pointless. Still build zonelist for
* self because we need to handle memoryless nodes.
*/
> + if (self && !node_online(self->node_id))
> build_zonelists(self);
> - }
> -
> - for_each_online_node(nid) {
> - pg_data_t *pgdat = NODE_DATA(nid);
> + else
> + for_each_online_node(nid) {
> + pg_data_t *pgdat = NODE_DATA(nid);
>
> - build_zonelists(pgdat);
> - }
> + build_zonelists(pgdat);
> + }
>
> /*
> * Initialize the boot_pagesets that are going to be used
> --
> 2.11.0
>
> --
> 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>
--
Michal Hocko
SUSE Labs
--
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] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
2017-06-28 9:23 ` Michal Hocko
@ 2017-06-28 9:35 ` Vlastimil Babka
-1 siblings, 0 replies; 12+ messages in thread
From: Vlastimil Babka @ 2017-06-28 9:35 UTC (permalink / raw)
To: Michal Hocko, Wei Yang; +Cc: akpm, linux-mm, linux-kernel
On 06/28/2017 11:23 AM, Michal Hocko wrote:
> On Mon 26-06-17 11:58:22, Wei Yang wrote:
>> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
>> zonelists when creating new pgdat" tries to build the correct zonelist for
>> a new added node, while it is not necessary to rebuild it for already exist
>> nodes.
>>
>> In build_zonelists(), it will iterate on nodes with memory. For a new added
>> node, it will have memory until node_states_set_node() is called in
>> online_pages().
>>
>> This patch will avoid to rebuild the zonelists for already exist nodes.
>
> It is not very clear from the changelog why that actually matters. The
> only effect I can see is that other zonelists on other online nodes will
> not learn about the currently memory less node. This is a good think
> because we do not pointlessly try to allocate from that node.
build_zonelists_node() seems to use managed_zone(zone) checks, so it
should not include empty zones anyway. So effectively seems to me we
just avoid some pointless work under stop_machine().
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>
> Acked-by: Michal Hocko <mhocko@suse.com>
>
>> ---
>> mm/page_alloc.c | 16 +++++++++-------
>> 1 file changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 560eafe8234d..fc8181b44fd8 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
>> memset(node_load, 0, sizeof(node_load));
>> #endif
>>
>> - if (self && !node_online(self->node_id)) {
>> + /* This node is hotadded and no memory preset yet.
>> + * So just build zonelists is fine, no need to touch other nodes.
>> + */
>
> This comment doesn't make much sense to me. What about
> /*
> * Do not rebuild zonelists on all online nodes if the current
> * node is not online yet (it doesn't have any memory) and
> * allocating from it is pointless. Still build zonelist for
> * self because we need to handle memoryless nodes.
> */
>> + if (self && !node_online(self->node_id))
>> build_zonelists(self);
>> - }
>> -
>> - for_each_online_node(nid) {
>> - pg_data_t *pgdat = NODE_DATA(nid);
>> + else
>> + for_each_online_node(nid) {
>> + pg_data_t *pgdat = NODE_DATA(nid);
>>
>> - build_zonelists(pgdat);
>> - }
>> + build_zonelists(pgdat);
>> + }
>>
>> /*
>> * Initialize the boot_pagesets that are going to be used
>> --
>> 2.11.0
>>
>> --
>> 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] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
@ 2017-06-28 9:35 ` Vlastimil Babka
0 siblings, 0 replies; 12+ messages in thread
From: Vlastimil Babka @ 2017-06-28 9:35 UTC (permalink / raw)
To: Michal Hocko, Wei Yang; +Cc: akpm, linux-mm, linux-kernel
On 06/28/2017 11:23 AM, Michal Hocko wrote:
> On Mon 26-06-17 11:58:22, Wei Yang wrote:
>> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
>> zonelists when creating new pgdat" tries to build the correct zonelist for
>> a new added node, while it is not necessary to rebuild it for already exist
>> nodes.
>>
>> In build_zonelists(), it will iterate on nodes with memory. For a new added
>> node, it will have memory until node_states_set_node() is called in
>> online_pages().
>>
>> This patch will avoid to rebuild the zonelists for already exist nodes.
>
> It is not very clear from the changelog why that actually matters. The
> only effect I can see is that other zonelists on other online nodes will
> not learn about the currently memory less node. This is a good think
> because we do not pointlessly try to allocate from that node.
build_zonelists_node() seems to use managed_zone(zone) checks, so it
should not include empty zones anyway. So effectively seems to me we
just avoid some pointless work under stop_machine().
>> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
>
> Acked-by: Michal Hocko <mhocko@suse.com>
>
>> ---
>> mm/page_alloc.c | 16 +++++++++-------
>> 1 file changed, 9 insertions(+), 7 deletions(-)
>>
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 560eafe8234d..fc8181b44fd8 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -5200,15 +5200,17 @@ static int __build_all_zonelists(void *data)
>> memset(node_load, 0, sizeof(node_load));
>> #endif
>>
>> - if (self && !node_online(self->node_id)) {
>> + /* This node is hotadded and no memory preset yet.
>> + * So just build zonelists is fine, no need to touch other nodes.
>> + */
>
> This comment doesn't make much sense to me. What about
> /*
> * Do not rebuild zonelists on all online nodes if the current
> * node is not online yet (it doesn't have any memory) and
> * allocating from it is pointless. Still build zonelist for
> * self because we need to handle memoryless nodes.
> */
>> + if (self && !node_online(self->node_id))
>> build_zonelists(self);
>> - }
>> -
>> - for_each_online_node(nid) {
>> - pg_data_t *pgdat = NODE_DATA(nid);
>> + else
>> + for_each_online_node(nid) {
>> + pg_data_t *pgdat = NODE_DATA(nid);
>>
>> - build_zonelists(pgdat);
>> - }
>> + build_zonelists(pgdat);
>> + }
>>
>> /*
>> * Initialize the boot_pagesets that are going to be used
>> --
>> 2.11.0
>>
>> --
>> 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] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
2017-06-28 9:35 ` Vlastimil Babka
@ 2017-06-28 9:45 ` Michal Hocko
-1 siblings, 0 replies; 12+ messages in thread
From: Michal Hocko @ 2017-06-28 9:45 UTC (permalink / raw)
To: Vlastimil Babka; +Cc: Wei Yang, akpm, linux-mm, linux-kernel
On Wed 28-06-17 11:35:00, Vlastimil Babka wrote:
> On 06/28/2017 11:23 AM, Michal Hocko wrote:
> > On Mon 26-06-17 11:58:22, Wei Yang wrote:
> >> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
> >> zonelists when creating new pgdat" tries to build the correct zonelist for
> >> a new added node, while it is not necessary to rebuild it for already exist
> >> nodes.
> >>
> >> In build_zonelists(), it will iterate on nodes with memory. For a new added
> >> node, it will have memory until node_states_set_node() is called in
> >> online_pages().
> >>
> >> This patch will avoid to rebuild the zonelists for already exist nodes.
> >
> > It is not very clear from the changelog why that actually matters. The
> > only effect I can see is that other zonelists on other online nodes will
> > not learn about the currently memory less node. This is a good think
> > because we do not pointlessly try to allocate from that node.
>
> build_zonelists_node() seems to use managed_zone(zone) checks, so it
> should not include empty zones anyway. So effectively seems to me we
> just avoid some pointless work under stop_machine().
Ohh, you are right. I was looking for populated_zone and didn't find any
so I thought we just do not care. So, indeed the patch has no functional
effect it just reduces the stop_machine overhead tiny bit.
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mm/memory_hotplug: just build zonelist for new added node
@ 2017-06-28 9:45 ` Michal Hocko
0 siblings, 0 replies; 12+ messages in thread
From: Michal Hocko @ 2017-06-28 9:45 UTC (permalink / raw)
To: Vlastimil Babka; +Cc: Wei Yang, akpm, linux-mm, linux-kernel
On Wed 28-06-17 11:35:00, Vlastimil Babka wrote:
> On 06/28/2017 11:23 AM, Michal Hocko wrote:
> > On Mon 26-06-17 11:58:22, Wei Yang wrote:
> >> In commit (9adb62a5df9c0fbef7) "mm/hotplug: correctly setup fallback
> >> zonelists when creating new pgdat" tries to build the correct zonelist for
> >> a new added node, while it is not necessary to rebuild it for already exist
> >> nodes.
> >>
> >> In build_zonelists(), it will iterate on nodes with memory. For a new added
> >> node, it will have memory until node_states_set_node() is called in
> >> online_pages().
> >>
> >> This patch will avoid to rebuild the zonelists for already exist nodes.
> >
> > It is not very clear from the changelog why that actually matters. The
> > only effect I can see is that other zonelists on other online nodes will
> > not learn about the currently memory less node. This is a good think
> > because we do not pointlessly try to allocate from that node.
>
> build_zonelists_node() seems to use managed_zone(zone) checks, so it
> should not include empty zones anyway. So effectively seems to me we
> just avoid some pointless work under stop_machine().
Ohh, you are right. I was looking for populated_zone and didn't find any
so I thought we just do not care. So, indeed the patch has no functional
effect it just reduces the stop_machine overhead tiny bit.
--
Michal Hocko
SUSE Labs
--
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] 12+ messages in thread
end of thread, other threads:[~2017-06-28 9:45 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 3:58 [PATCH] mm/memory_hotplug: just build zonelist for new added node Wei Yang
2017-06-26 3:58 ` Wei Yang
2017-06-28 7:06 ` Vlastimil Babka
2017-06-28 7:06 ` Vlastimil Babka
2017-06-28 7:28 ` Wei Yang
2017-06-28 7:28 ` Wei Yang
2017-06-28 9:23 ` Michal Hocko
2017-06-28 9:23 ` Michal Hocko
2017-06-28 9:35 ` Vlastimil Babka
2017-06-28 9:35 ` Vlastimil Babka
2017-06-28 9:45 ` Michal Hocko
2017-06-28 9:45 ` Michal Hocko
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.