All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yang <richard.weiyang@gmail.com>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, Wei Yang <richard.weiyang@gmail.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	David Hildenbrand <david@redhat.com>,
	Oscar Salvador <osalvador@suse.de>
Subject: [Patch v2 2/2] mm/page_alloc: not necessary to multiply MAX_NODE_LOAD
Date: Fri,  8 Apr 2022 02:59:47 +0000	[thread overview]
Message-ID: <20220408025947.1619-2-richard.weiyang@gmail.com> (raw)
In-Reply-To: <20220408025947.1619-1-richard.weiyang@gmail.com>

Since we just increase a constance of 1 to node penalty, it is not
necessary to multiply MAX_NODE_LOAD for preference.

This patch also remove the definition.

[vbabka@suse.cz: suggests]

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Vlastimil Babka <vbabka@suse.cz>
CC: David Hildenbrand <david@redhat.com>
CC: Oscar Salvador <osalvador@suse.de>
---
 mm/page_alloc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 86b6573fbeb5..ca6a127bbc26 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6170,7 +6170,6 @@ int numa_zonelist_order_handler(struct ctl_table *table, int write,
 }
 
 
-#define MAX_NODE_LOAD (nr_online_nodes)
 static int node_load[MAX_NUMNODES];
 
 /**
@@ -6217,7 +6216,7 @@ int find_next_best_node(int node, nodemask_t *used_node_mask)
 			val += PENALTY_FOR_NODE_WITH_CPUS;
 
 		/* Slight preference for less loaded node */
-		val *= (MAX_NODE_LOAD*MAX_NUMNODES);
+		val *= MAX_NUMNODES;
 		val += node_load[n];
 
 		if (val < min_val) {
-- 
2.33.1



  reply	other threads:[~2022-04-08  3:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08  2:59 [Patch v2 1/2] mm/page_alloc: add same penalty is enough to get round-robin order Wei Yang
2022-04-08  2:59 ` Wei Yang [this message]
2022-04-08  8:09   ` [Patch v2 2/2] mm/page_alloc: not necessary to multiply MAX_NODE_LOAD David Hildenbrand
2022-04-08 23:07     ` Wei Yang
2022-04-11 10:52       ` Vlastimil Babka
2022-04-12  0:02         ` Wei Yang
2022-04-12  7:53         ` David Hildenbrand

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=20220408025947.1619-2-richard.weiyang@gmail.com \
    --to=richard.weiyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=osalvador@suse.de \
    --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 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.