mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched/fair: Correct misleading comment in task_numa_migrate()
@ 2025-09-08  6:19 Jianyong Wu
  2025-09-08 16:25 ` Rik van Riel
  0 siblings, 1 reply; 3+ messages in thread
From: Jianyong Wu @ 2025-09-08  6:19 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, riel, vincent.guittot, jianyong.wu,
	wujianyong
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, vschneid, linux-kernel

The current comment implies that both the task and the group must get
benefit for a node to be considered. However, the actual code allows
a node to pass if *either* the task *or* the group meets the criteria.

As established in the previous discussion [1], the code logic is correct.
Update the comment to accurately reflect that either condition is
sufficient.

Signed-off-by: Jianyong Wu <wujianyong@hygon.cn>

[1] Link: https://lore.kernel.org/lkml/55806A24.7030403@redhat.com/
---
 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..9069ea4c71f1 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2565,7 +2565,7 @@ static int task_numa_migrate(struct task_struct *p)
 				groupweight = group_weight(p, env.src_nid, dist);
 			}
 
-			/* Only consider nodes where both task and groups benefit */
+			/* Consider nodes where either task or groups benefit */
 			taskimp = task_weight(p, nid, dist) - taskweight;
 			groupimp = group_weight(p, nid, dist) - groupweight;
 			if (taskimp < 0 && groupimp < 0)
-- 
2.43.0



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

end of thread, other threads:[~2025-09-26 12:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-08  6:19 [PATCH] sched/fair: Correct misleading comment in task_numa_migrate() Jianyong Wu
2025-09-08 16:25 ` Rik van Riel
2025-09-26 11:59   ` Jianyong Wu

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

all inboxes | Powered by JetHome®