linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Pengfei Li <fly@kernel.page>
To: akpm@linux-foundation.org
Cc: mgorman@techsingularity.net, mhocko@kernel.org, vbabka@suse.cz,
	cl@linux.com, iamjoonsoo.kim@lge.com, guro@fb.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Pengfei Li <fly@kernel.page>
Subject: [RFC v1 16/19] mm, page_alloc: cleanup build_zonelists
Date: Thu, 21 Nov 2019 23:18:08 +0800	[thread overview]
Message-ID: <20191121151811.49742-17-fly@kernel.page> (raw)
In-Reply-To: <20191121151811.49742-1-fly@kernel.page>

This is a cleanup patch.

Renaming some functions and variables when initializing nodelist
is xxx_nodelist instead of xxx_zonelist.

Signed-off-by: Pengfei Li <fly@kernel.page>
---
 include/linux/mmzone.h |  2 +-
 init/main.c            |  2 +-
 mm/memory_hotplug.c    |  6 +++---
 mm/page_alloc.c        | 20 ++++++++++----------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 599b30620aa1..f1a492c13037 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -813,7 +813,7 @@ static inline bool pgdat_is_empty(pg_data_t *pgdat)
 
 #include <linux/memory_hotplug.h>
 
-void build_all_zonelists(pg_data_t *pgdat);
+void build_all_nodelists(pg_data_t *pgdat);
 void wakeup_kswapd(pg_data_t *pgdat, gfp_t gfp_mask, int order,
 		   enum zone_type classzone_idx);
 bool __zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark,
diff --git a/init/main.c b/init/main.c
index 4d814de017ee..d561bdc537eb 100644
--- a/init/main.c
+++ b/init/main.c
@@ -602,7 +602,7 @@ asmlinkage __visible void __init start_kernel(void)
 	smp_prepare_boot_cpu();	/* arch-specific boot-cpu hooks */
 	boot_cpu_hotplug_init();
 
-	build_all_zonelists(NULL);
+	build_all_nodelists(NULL);
 	page_alloc_init();
 
 	pr_notice("Kernel command line: %s\n", boot_command_line);
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 46b2e056a43f..3c63529df112 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -821,7 +821,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_typ
 
 	node_states_set_node(nid, &arg);
 	if (need_zonelists_rebuild)
-		build_all_zonelists(NULL);
+		build_all_nodelists(NULL);
 	else
 		zone_pcp_update(zone);
 
@@ -904,7 +904,7 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start)
 	 * The node we allocated has no zone fallback lists. For avoiding
 	 * to access not-initialized zonelist, build here.
 	 */
-	build_all_zonelists(pgdat);
+	build_all_nodelists(pgdat);
 
 	/*
 	 * When memory is hot-added, all the memory is in offline state. So
@@ -1565,7 +1565,7 @@ static int __ref __offline_pages(unsigned long start_pfn,
 
 	if (!populated_zone(zone)) {
 		zone_pcp_reset(zone);
-		build_all_zonelists(NULL);
+		build_all_nodelists(NULL);
 	} else
 		zone_pcp_update(zone);
 
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 5b735eb88c0d..146abe537300 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5631,7 +5631,7 @@ static void build_thisnode_nodelists(pg_data_t *pgdat)
  * may still exist in local DMA zone.
  */
 
-static void build_zonelists(pg_data_t *pgdat)
+static void build_nodelists(pg_data_t *pgdat)
 {
 	static int node_order[MAX_NUMNODES];
 	int node, load, nr_nodes = 0;
@@ -5682,7 +5682,7 @@ static void setup_min_unmapped_ratio(void);
 static void setup_min_slab_ratio(void);
 #else	/* CONFIG_NUMA */
 
-static void build_zonelists(pg_data_t *pgdat)
+static void build_nodelists(pg_data_t *pgdat)
 {
 	int node, local_node;
 	struct nlist_entry *entry;
@@ -5737,7 +5737,7 @@ static void setup_pageset(struct per_cpu_pageset *p, unsigned long batch);
 static DEFINE_PER_CPU(struct per_cpu_pageset, boot_pageset);
 static DEFINE_PER_CPU(struct per_cpu_nodestat, boot_nodestats);
 
-static void __build_all_zonelists(void *data)
+static void __build_all_nodelists(void *data)
 {
 	int nid;
 	int __maybe_unused cpu;
@@ -5755,12 +5755,12 @@ static void __build_all_zonelists(void *data)
 	 * building zonelists is fine - no need to touch other nodes.
 	 */
 	if (self && !node_online(self->node_id)) {
-		build_zonelists(self);
+		build_nodelists(self);
 	} else {
 		for_each_online_node(nid) {
 			pg_data_t *pgdat = NODE_DATA(nid);
 
-			build_zonelists(pgdat);
+			build_nodelists(pgdat);
 		}
 
 #ifdef CONFIG_HAVE_MEMORYLESS_NODES
@@ -5781,11 +5781,11 @@ static void __build_all_zonelists(void *data)
 }
 
 static noinline void __init
-build_all_zonelists_init(void)
+build_all_nodelists_init(void)
 {
 	int cpu;
 
-	__build_all_zonelists(NULL);
+	__build_all_nodelists(NULL);
 
 	/*
 	 * Initialize the boot_pagesets that are going to be used
@@ -5813,12 +5813,12 @@ build_all_zonelists_init(void)
  * __ref due to call of __init annotated helper build_all_zonelists_init
  * [protected by SYSTEM_BOOTING].
  */
-void __ref build_all_zonelists(pg_data_t *pgdat)
+void __ref build_all_nodelists(pg_data_t *pgdat)
 {
 	if (system_state == SYSTEM_BOOTING) {
-		build_all_zonelists_init();
+		build_all_nodelists_init();
 	} else {
-		__build_all_zonelists(pgdat);
+		__build_all_nodelists(pgdat);
 		/* cpuset refresh routine should be here */
 	}
 	vm_total_pages = nr_free_pagecache_pages();
-- 
2.23.0



  parent reply	other threads:[~2019-11-21 15:22 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 15:17 [RFC v1 00/19] Modify zonelist to nodelist v1 Pengfei Li
2019-11-21 15:17 ` [RFC v1 01/19] mm, mmzone: modify zonelist to nodelist Pengfei Li
2019-11-21 15:17 ` [RFC v1 02/19] mm, hugetlb: use for_each_node in dequeue_huge_page_nodemask() Pengfei Li
2019-11-21 15:17 ` [RFC v1 03/19] mm, oom_kill: use for_each_node in constrained_alloc() Pengfei Li
2019-11-21 15:17 ` [RFC v1 04/19] mm, slub: use for_each_node in get_any_partial() Pengfei Li
2019-11-21 15:17 ` [RFC v1 05/19] mm, slab: use for_each_node in fallback_alloc() Pengfei Li
2019-11-21 15:17 ` [RFC v1 06/19] mm, vmscan: use for_each_node in do_try_to_free_pages() Pengfei Li
2019-11-21 15:17 ` [RFC v1 07/19] mm, vmscan: use first_node in throttle_direct_reclaim() Pengfei Li
2019-11-21 15:18 ` [RFC v1 08/19] mm, vmscan: pass pgdat to wakeup_kswapd() Pengfei Li
2019-11-21 15:18 ` [RFC v1 09/19] mm, vmscan: use for_each_node in shrink_zones() Pengfei Li
2019-11-21 15:18 ` [RFC v1 10/19] mm, page_alloc: use for_each_node in wake_all_kswapds() Pengfei Li
2019-11-21 15:18 ` [RFC v1 11/19] mm, mempolicy: use first_node in mempolicy_slab_node() Pengfei Li
2019-11-21 15:18 ` [RFC v1 12/19] mm, mempolicy: use first_node in mpol_misplaced() Pengfei Li
2019-11-21 15:18 ` [RFC v1 13/19] mm, page_alloc: use first_node in local_memory_node() Pengfei Li
2019-11-21 15:18 ` [RFC v1 14/19] mm, compaction: rename compaction_zonelist_suitable Pengfei Li
2019-11-21 15:18 ` [RFC v1 15/19] mm, mm_init: rename mminit_verify_zonelist Pengfei Li
2019-11-21 15:18 ` Pengfei Li [this message]
2019-11-21 15:18 ` [RFC v1 17/19] mm, memory_hotplug: cleanup online_pages() Pengfei Li
2019-11-21 15:18 ` [RFC v1 18/19] kernel, sysctl: cleanup numa_zonelist_order Pengfei Li
2019-11-21 15:18 ` [RFC v1 19/19] mm, mmzone: cleanup zonelist in comments Pengfei Li
2019-11-21 18:04 ` [RFC v1 00/19] Modify zonelist to nodelist v1 Michal Hocko
2019-11-22 15:05   ` Pengfei Li
2019-11-25  8:40     ` Michal Hocko
2019-11-25 14:46       ` Pengfei Li
2019-11-25 15:46         ` Michal Hocko
2019-11-22  7:25 ` lixinhai.lxh
2019-11-22 10:14   ` David Hildenbrand
2019-11-22 15:28   ` Pengfei Li
2019-11-22 15:53     ` Qian Cai
2019-11-22 17:44       ` Pengfei Li
2019-11-25  8:39       ` Michal Hocko
2019-11-26 15:30         ` Qian Cai
2019-11-26 15:41           ` Michal Hocko
2019-11-26 19:04             ` Qian Cai
2019-11-27  8:50               ` Michal Hocko
2019-11-22 10:03 ` David Hildenbrand
2019-11-22 15:49   ` Pengfei Li
2019-11-22 15:53     ` Christopher Lameter
2019-11-22 16:06       ` David Hildenbrand
2019-11-22 17:36       ` Pengfei Li
2019-11-22 18:24         ` Christopher Lameter

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=20191121151811.49742-17-fly@kernel.page \
    --to=fly@kernel.page \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=guro@fb.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --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).