linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_alloc: clear node_load[] in function build_zonelists
@ 2022-01-15 23:00 Wei Yang
  2022-01-15 23:45 ` Wei Yang
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yang @ 2022-01-15 23:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, mhocko, Wei Yang

static variable node_load[] is a helper variable during build zonelist.
On each turn for building zonelist, node_load[] is cleared. So this is
proper to do this in function build_zonelist.

Another side effect is,  #ifdef CONFIG_NUMA could be removed since
node_load[] is only defined when CONFIG_NUMA is set.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 mm/page_alloc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index c5952749ad40..8245f5a24aad 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6255,6 +6255,7 @@ static void build_zonelists(pg_data_t *pgdat)
 	prev_node = local_node;
 
 	memset(node_order, 0, sizeof(node_order));
+	memset(node_load, 0, sizeof(node_load));
 	while ((node = find_next_best_node(local_node, &used_mask)) >= 0) {
 		/*
 		 * We don't want to pressure a particular node.
@@ -6371,10 +6372,6 @@ static void __build_all_zonelists(void *data)
 
 	spin_lock(&lock);
 
-#ifdef CONFIG_NUMA
-	memset(node_load, 0, sizeof(node_load));
-#endif
-
 	/*
 	 * This node is hotadded and no memory is yet present.   So just
 	 * building zonelists is fine - no need to touch other nodes.
-- 
2.33.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/page_alloc: clear node_load[] in function build_zonelists
  2022-01-15 23:00 [PATCH] mm/page_alloc: clear node_load[] in function build_zonelists Wei Yang
@ 2022-01-15 23:45 ` Wei Yang
  0 siblings, 0 replies; 2+ messages in thread
From: Wei Yang @ 2022-01-15 23:45 UTC (permalink / raw)
  To: Wei Yang; +Cc: akpm, linux-mm, linux-kernel, mhocko

On Sat, Jan 15, 2022 at 11:00:02PM +0000, Wei Yang wrote:
>static variable node_load[] is a helper variable during build zonelist.
>On each turn for building zonelist, node_load[] is cleared. So this is
>proper to do this in function build_zonelist.
>

Hm... sounds I missed some important part of this operation.

Please forget this one :-(

>Another side effect is,  #ifdef CONFIG_NUMA could be removed since
>node_load[] is only defined when CONFIG_NUMA is set.
>

-- 
Wei Yang
Help you, Help me


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-15 23:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-15 23:00 [PATCH] mm/page_alloc: clear node_load[] in function build_zonelists Wei Yang
2022-01-15 23:45 ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox