Skip to content

Commit de5eb2d

Browse files
JoonsooKimIngo Molnar
authored andcommitted
sched: Explicitly cpu_idle_type checking in rebalance_domains()
After commit 88b8dac, dst-cpu can be changed in load_balance(), then we can't know cpu_idle_type of dst-cpu when load_balance() return positive. So, add explicit cpu_idle_type checking. Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com> Tested-by: Jason Low <jason.low2@hp.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com> Cc: Davidlohr Bueso <davidlohr.bueso@hp.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1366705662-3587-3-git-send-email-iamjoonsoo.kim@lge.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent f1cd085 commit de5eb2d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

kernel/sched/fair.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5523,10 +5523,11 @@ static void rebalance_domains(int cpu, enum cpu_idle_type idle)
55235523
if (time_after_eq(jiffies, sd->last_balance + interval)) {
55245524
if (load_balance(cpu, rq, sd, idle, &balance)) {
55255525
/*
5526-
* We've pulled tasks over so either we're no
5527-
* longer idle.
5526+
* The LBF_SOME_PINNED logic could have changed
5527+
* env->dst_cpu, so we can't know our idle
5528+
* state even if we migrated tasks. Update it.
55285529
*/
5529-
idle = CPU_NOT_IDLE;
5530+
idle = idle_cpu(cpu) ? CPU_IDLE : CPU_NOT_IDLE;
55305531
}
55315532
sd->last_balance = jiffies;
55325533
}

0 commit comments

Comments
 (0)