[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250829085717.15737-1-wujianyong@hygon.cn>
Date: Fri, 29 Aug 2025 16:57:17 +0800
From: Jianyong Wu <wujianyong@...on.cn>
To: <mingo@...hat.com>, <peterz@...radead.org>, <juri.lelli@...hat.com>,
<vincent.guittot@...aro.org>, <dietmar.eggemann@....com>,
<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
<vschneid@...hat.com>, <wujianyong@...on.cn>
CC: <jianyong.wu@...look.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] sched/fair: fix task_numa_migrate to consider both task and group benefits
The comment indicates that when searching for a suitable NUMA node, we
should ensure that the selected node benefits both the task and its NUMA
group. However, the current implementation can only guarantee that either
the task or the group benefits, but not necessarily both.
Signed-off-by: Jianyong Wu <wujianyong@...on.cn>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index b173a059315c..58c899738399 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2568,7 +2568,7 @@ static int task_numa_migrate(struct task_struct *p)
/* Only consider nodes where both task and groups benefit */
taskimp = task_weight(p, nid, dist) - taskweight;
groupimp = group_weight(p, nid, dist) - groupweight;
- if (taskimp < 0 && groupimp < 0)
+ if (taskimp < 0 || groupimp < 0)
continue;
env.dist = dist;
--
2.43.0
Powered by blists - more mailing lists