diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2023-07-11 10:13:59 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2023-07-13 15:21:53 +0200 |
commit | 7ee7642c91410fb90cc45e799a3a46e1607ecd79 (patch) | |
tree | f7341b13798fe92abf0c980e3d8ce034f9a6f735 /kernel/sched | |
parent | ed74cc4995d314ea6cbf406caf978c442f451fa5 (diff) |
sched/fair: Stabilize asym cpu capacity system idle cpu selection
select_idle_capacity() not only looks for an idle cpu that fits for the
waking task but also for cpu with highest bandwidth when no cpu fits.
Start the loop with target cpu so it will be selected 1st when no cpu fits
but several cpus shared the same bandwidth. Starting with target cpu
prevents the task to migrate between cpus with same bandwidth at every
wakeup when no cpu fits.
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20230711081359.868862-1-vincent.guittot@linaro.org
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index a87988327f88..0cd1cdbae534 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7096,7 +7096,7 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target) util_min = uclamp_eff_value(p, UCLAMP_MIN); util_max = uclamp_eff_value(p, UCLAMP_MAX); - for_each_cpu_wrap(cpu, cpus, target + 1) { + for_each_cpu_wrap(cpu, cpus, target) { unsigned long cpu_cap = capacity_of(cpu); if (!available_idle_cpu(cpu) && !sched_idle_cpu(cpu)) |