kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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
On Mon, 2025-09-08 at 14:19 +0800, Jianyong Wu wrote: > 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> Reviewed-by: Rik van Riel <riel@surriel.com> -- All Rights Reversed.
Hi Peter, Rik, and maintainers, Gentle ping on this small comment fix patch. It was reviewed by Rik about 3 weeks ago and got a " Reviewed-by" [1]. Since then there has been no further comments. I just wonder if there are any other concerns or if it is ready to be picked up. The original patch is here: [1] https://lore.kernel.org/lkml/20250908061923.543081-1-wujianyong@hygon.cn/ Thanks for your time. Best regards, Jianyong Wu Jianyong Wu> -----Original Message----- > From: Rik van Riel <riel@surriel.com> > Sent: Tuesday, September 9, 2025 12:26 AM > To: Jianyong Wu <wujianyong@hygon.cn>; mingo@redhat.com; > peterz@infradead.org; juri.lelli@redhat.com; vincent.guittot@linaro.org; > jianyong.wu@outlook.com > Cc: dietmar.eggemann@arm.com; rostedt@goodmis.org; bsegall@google.com; > mgorman@suse.de; vschneid@redhat.com; linux-kernel@vger.kernel.org > Subject: Re: [PATCH] sched/fair: Correct misleading comment in > task_numa_migrate() > > On Mon, 2025-09-08 at 14:19 +0800, Jianyong Wu wrote: > > 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> > > Reviewed-by: Rik van Riel <riel@surriel.com> > > -- > All Rights Reversed.
© 2016 - 2025 Red Hat, Inc.