Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 7ee7642

Browse files
vingu-linaroPeter Zijlstra
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent ed74cc4 commit 7ee7642

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched/fair.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7096,7 +7096,7 @@ select_idle_capacity(struct task_struct *p, struct sched_domain *sd, int target)
70967096
util_min = uclamp_eff_value(p, UCLAMP_MIN);
70977097
util_max = uclamp_eff_value(p, UCLAMP_MAX);
70987098

7099-
for_each_cpu_wrap(cpu, cpus, target + 1) {
7099+
for_each_cpu_wrap(cpu, cpus, target) {
71007100
unsigned long cpu_cap = capacity_of(cpu);
71017101

71027102
if (!available_idle_cpu(cpu) && !sched_idle_cpu(cpu))

0 commit comments

Comments
 (0)