linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Gregory Price <gourry.memverge@gmail.com>
To: linux-mm@kvack.org
Cc: akpm@linux-foundation.org, ying.huang@intel.com,
	Gregory Price <gregory.price@memverge.com>
Subject: [PATCH] mm/mempolicy: weighted interleave checks wrong parameter
Date: Tue,  6 Feb 2024 14:28:53 -0500	[thread overview]
Message-ID: <20240206192853.3589-1-gregory.price@memverge.com> (raw)

Hi Andrew,

Can you add this hotfix to d866f3b594ce3324947fef017bbbec1f4eb237ea on
linux-next? This was reported after you picked up the patch line.
Can probably be squashed, wasn't worth a full version.

~Gregory
---


weighted interleave presently checks (!node) when it should check
(!il_weight).  This causes a wrong distribution of memory.

Reported-by: "Huang, Ying" <ying.huang@intel.com>
Signed-off-by: Gregory Price <gregory.price@memverge.com>
---
 mm/mempolicy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index ed0d5d2d456a..ba0b2b81bd08 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1885,7 +1885,7 @@ static unsigned int weighted_interleave_nodes(struct mempolicy *policy)
 	/* to prevent miscount use tsk->mems_allowed_seq to detect rebind */
 	cpuset_mems_cookie = read_mems_allowed_begin();
 	node = current->il_prev;
-	if (!node || !node_isset(node, policy->nodes)) {
+	if (!current->il_weight || !node_isset(node, policy->nodes)) {
 		node = next_node_in(node, policy->nodes);
 		if (read_mems_allowed_retry(cpuset_mems_cookie))
 			goto retry;
-- 
2.39.1



                 reply	other threads:[~2024-02-06 19:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240206192853.3589-1-gregory.price@memverge.com \
    --to=gourry.memverge@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregory.price@memverge.com \
    --cc=linux-mm@kvack.org \
    --cc=ying.huang@intel.com \
    /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