From: Wei Yang <richard.weiyang@gmail.com>
To: akpm@linux-foundation.org, mhocko@suse.com, vbabka@suse.cz
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Wei Yang <richard.weiyang@gmail.com>
Subject: [PATCH] mm/memory_hotplug: just build zonelist for new added node
Date: Mon, 26 Jun 2017 11:58:22 +0800 [thread overview]
Message-ID: <20170626035822.50155-1-richard.weiyang@gmail.com> (raw)
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>
next reply other threads:[~2017-06-26 3:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-26 3:58 Wei Yang [this message]
2017-06-28 7:06 ` [PATCH] mm/memory_hotplug: just build zonelist for new added node Vlastimil Babka
2017-06-28 7:28 ` Wei Yang
2017-06-28 9:23 ` Michal Hocko
2017-06-28 9:35 ` Vlastimil Babka
2017-06-28 9:45 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170626035822.50155-1-richard.weiyang@gmail.com \
--to=richard.weiyang@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).