diff mbox series

[RFC,v1,17/19] mm, memory_hotplug: cleanup online_pages()

Message ID 20191121151811.49742-18-fly@kernel.page (mailing list archive)
State New, archived
Headers show
Series Modify zonelist to nodelist v1 | expand

Commit Message

Pengfei Li Nov. 21, 2019, 3:18 p.m. UTC
This is a cleanup patch.

In online_pages(), rename the local variable need_zonelists_rebuild
to need_nodelists_rebuild.

Signed-off-by: Pengfei Li <fly@kernel.page>
---
 mm/memory_hotplug.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 3c63529df112..3ff55da7b225 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -760,10 +760,10 @@  struct zone * zone_for_pfn_range(int online_type, int nid, unsigned start_pfn,
 
 int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_type)
 {
-	unsigned long flags;
+	bool need_nodelists_rebuild = false;
 	unsigned long onlined_pages = 0;
+	unsigned long flags;
 	struct zone *zone;
-	int need_zonelists_rebuild = 0;
 	int nid;
 	int ret;
 	struct memory_notify arg;
@@ -798,7 +798,7 @@  int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 	 * So, zonelist must be updated after online.
 	 */
 	if (!populated_zone(zone)) {
-		need_zonelists_rebuild = 1;
+		need_nodelists_rebuild = true;
 		setup_zone_pageset(zone);
 	}
 
@@ -806,7 +806,7 @@  int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 		online_pages_range);
 	if (ret) {
 		/* not a single memory resource was applicable */
-		if (need_zonelists_rebuild)
+		if (need_nodelists_rebuild)
 			zone_pcp_reset(zone);
 		goto failed_addition;
 	}
@@ -820,7 +820,7 @@  int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 	shuffle_zone(zone);
 
 	node_states_set_node(nid, &arg);
-	if (need_zonelists_rebuild)
+	if (need_nodelists_rebuild)
 		build_all_nodelists(NULL);
 	else
 		zone_pcp_update(zone);