Commit 6d7e478
sched/fair: Fix the decision for load balance
should_we_balance is called for the decision to do load-balancing.
When sched ticks invoke this function, only one CPU should return
true. However, in the current code, two CPUs can return true. The
following situation, where b means busy and i means idle, is an
example, because CPU 0 and CPU 2 return true.
[0, 1] [2, 3]
b b i b
This fix checks if there exists an idle CPU with busy sibling(s)
after looking for a CPU on an idle core. If some idle CPUs with busy
siblings are found, just the first one should do load-balancing.
Fixes: b1bfeab ("sched/fair: Consider the idle state of the whole core for load balance")
Signed-off-by: Keisuke Nishimura <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Chen Yu <[email protected]>
Reviewed-by: Shrikanth Hegde <[email protected]>
Reviewed-by: Vincent Guittot <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]1 parent 8b39d20 commit 6d7e478
1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11184 | 11184 | | |
11185 | 11185 | | |
11186 | 11186 | | |
11187 | | - | |
| 11187 | + | |
| 11188 | + | |
| 11189 | + | |
| 11190 | + | |
11188 | 11191 | | |
11189 | 11192 | | |
11190 | 11193 | | |
11191 | | - | |
11192 | | - | |
| 11194 | + | |
| 11195 | + | |
| 11196 | + | |
11193 | 11197 | | |
11194 | 11198 | | |
11195 | 11199 | | |
| |||
0 commit comments