[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250627-rneri-fix-cas-clusters-v1-2-121ffb50bbc7@linux.intel.com>
Date: Fri, 27 Jun 2025 14:45:28 -0700
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>,
Tim C Chen <tim.c.chen@...ux.intel.com>, Barry Song <baohua@...nel.org>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>,
ricardo.neri@...el.com, linux-kernel@...r.kernel.org,
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Subject: [PATCH 2/4] sched/fair: Ignore misfit load if the destination CPU
cannot help
There is no point in identifying scheduling groups with misfit tasks if the
destination CPU cannot help (i.e., it has less than 20% greater capacity
than the most performant CPU in the group).
Since migrating misfit tasks takes precedence over relieving fully_busy
groups, identifying a group with misfit tasks causes a destination CPU of
smaller maximum capacity to back off (see capacity checks in update_sd_
pick_busiest()) even if it can help: it could help a group of equally small
maximum capacity if classified as fully_busy or has_spare.
The described situation can happen if a scheduling domain has groups of
big CPUs alongside two or more clusters of smaller CPUs that share L2
cache. Load should be balanced between these sets of smaller CPUs when
CONFIG_SCHED_CLUSTER is enabled.
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@...ux.intel.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 9da5014f8387..3c50ecffa4c7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -10302,7 +10302,9 @@ static inline void update_sg_lb_stats(struct lb_env *env,
if (local_group)
continue;
- if (sd_flags & SD_ASYM_CPUCAPACITY) {
+ /* Only look for misfit load if dst_cpu can help */
+ if (sd_flags & SD_ASYM_CPUCAPACITY &&
+ capacity_greater(capacity_of(env->dst_cpu), group->sgc->max_capacity)) {
/* Check for a misfit task on the cpu */
if (sgs->group_misfit_task_load < rq->misfit_task_load) {
sgs->group_misfit_task_load = rq->misfit_task_load;
--
2.43.0
Powered by blists - more mailing lists