Skip to content

Commit 56498cf

Browse files
gormanmPeter Zijlstra
authored andcommitted
sched/fair: Avoid a second scan of target in select_idle_cpu
When select_idle_cpu starts scanning for an idle CPU, it starts with a target CPU that has already been checked by select_idle_sibling. This patch starts with the next CPU instead. Signed-off-by: Mel Gorman <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 89aafd6 commit 56498cf

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
@@ -6220,7 +6220,7 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, bool
62206220
time = cpu_clock(this);
62216221
}
62226222

6223-
for_each_cpu_wrap(cpu, cpus, target) {
6223+
for_each_cpu_wrap(cpu, cpus, target + 1) {
62246224
if (has_idle_core) {
62256225
i = select_idle_core(p, cpu, cpus, &idle_cpu);
62266226
if ((unsigned int)i < nr_cpumask_bits)

0 commit comments

Comments
 (0)