Messages in this thread Patch in this message | | | From | Ricardo Neri <> | Subject | [PATCH 2/4] sched/fair: Do not disqualify either runqueues of SMT sched groups | Date | Thu, 25 Aug 2022 15:55:27 -0700 |
| |
We may be here because the busiest group is composed of SMT siblings and more than one is busy.
An idle CPU with lower priority can help the higher-priority busiest scheduling group by pulling tasks from it. The tasks that remain in the busiest group will run with higher performance.
This scenario is observed, for instance, on Intel hybrid processors. PCores have two SMT siblings and have higher priority than the ECores, which do not have SMT siblings.
Cc: Ben Segall <bsegall@google.com> Cc: Daniel Bristot de Oliveira <bristot@redhat.com> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com> Cc: Len Brown <len.brown@intel.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tim C. Chen <tim.c.chen@intel.com> Cc: Valentin Schneider <vschneid@redhat.com> Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Len Brown <len.brown@intel.com> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>> --- kernel/sched/fair.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 91f271ea02d2..810645eb58ed 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9662,10 +9662,14 @@ static struct rq *find_busiest_queue(struct lb_env *env, nr_running == 1) continue; - /* Make sure we only pull tasks from a CPU of lower priority */ + /* + * Make sure we only pull tasks from a CPU of lower priority. + * Except for scheduling groups composed of SMT siblings. + */ if ((env->sd->flags & SD_ASYM_PACKING) && sched_asym_prefer(i, env->dst_cpu) && - nr_running == 1) + nr_running == 1 && + !(group->flags & SD_SHARE_CPUCAPACITY)) continue; switch (env->migration_type) { -- 2.25.1
| |