[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250701024549.40166-3-adamli@os.amperecomputing.com>
Date: Tue, 1 Jul 2025 02:45:49 +0000
From: Adam Li <adamli@...amperecomputing.com>
To: mingo@...hat.com,
peterz@...radead.org,
juri.lelli@...hat.com,
vincent.guittot@...aro.org
Cc: dietmar.eggemann@....com,
rostedt@...dmis.org,
bsegall@...gle.com,
mgorman@...e.de,
vschneid@...hat.com,
cl@...ux.com,
linux-kernel@...r.kernel.org,
patches@...erecomputing.com,
Adam Li <adamli@...amperecomputing.com>
Subject: [PATCH 2/2] sched/fair: Only count group weight for allowed CPUs when looking for dst group
A task may not use all the CPUs in a schedule group due to CPU affinity.
If group weight includes CPUs not allowed to run the task,
group classification may be incorrect.
Signed-off-by: Adam Li <adamli@...amperecomputing.com>
---
kernel/sched/fair.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 78a3d9b78e07..452e2df961b9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10722,7 +10722,9 @@ static inline void update_sg_wakeup_stats(struct sched_domain *sd,
sgs->group_capacity = group->sgc->capacity;
- sgs->group_weight = group->group_weight;
+ /* Only count group_weight if p can run on these cpus */
+ sgs->group_weight = cpumask_weight_and(sched_group_span(group),
+ p->cpus_ptr);
sgs->group_type = group_classify(sd->imbalance_pct, group, sgs);
--
2.34.1
Powered by blists - more mailing lists