diff options
author | Jeffrey Hugo <[email protected]> | 2017-06-07 13:18:57 -0600 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2017-07-05 16:28:48 +0200 |
commit | 65a4433aebe36c8c6abeb69b99ef00274b971c6c (patch) | |
tree | f31dbba847c65ce9470dec8fc8a42cfd7a0824ff /lib/string_helpers.c | |
parent | 2a42eb9594a1480b4ead9e036e06ee1290e5fa6d (diff) |
sched/fair: Fix load_balance() affinity redo path
If load_balance() fails to migrate any tasks because all tasks were
affined, load_balance() removes the source CPU from consideration and
attempts to redo and balance among the new subset of CPUs.
There is a bug in this code path where the algorithm considers all active
CPUs in the system (minus the source that was just masked out). This is
not valid for two reasons: some active CPUs may not be in the current
scheduling domain and one of the active CPUs is dst_cpu. These CPUs should
not be considered, as we cannot pull load from them.
Instead of failing out of load_balance(), we may end up redoing the search
with no valid CPUs and incorrectly concluding the domain is balanced.
Additionally, if the group_imbalance flag was just set, it may also be
incorrectly unset, thus the flag will not be seen by other CPUs in future
load_balance() runs as that algorithm intends.
Fix the check by removing CPUs not in the current domain and the dst_cpu
from considertation, thus limiting the evaluation to valid remaining CPUs
from which load might be migrated.
Co-authored-by: Austin Christ <[email protected]>
Co-authored-by: Dietmar Eggemann <[email protected]>
Tested-by: Tyler Baicar <[email protected]>
Signed-off-by: Jeffrey Hugo <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: Austin Christ <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Timur Tabi <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'lib/string_helpers.c')
0 files changed, 0 insertions, 0 deletions