diff options
author | Valentin Schneider <valentin.schneider@arm.com> | 2021-05-26 23:57:50 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2021-06-01 17:00:11 +0300 |
commit | 475ea6c60279e9f2ddf7e4cf2648cd8ae0608361 (patch) | |
tree | d883c9408ae9ec0b7dc52ecdc9b74b7633a5913a /include/linux | |
parent | 08f7c2f4d0e9f4283f5796b8168044c034a1bfcb (diff) | |
download | linux-475ea6c60279e9f2ddf7e4cf2648cd8ae0608361.tar.xz |
sched: Don't defer CPU pick to migration_cpu_stop()
Will reported that the 'XXX __migrate_task() can fail' in migration_cpu_stop()
can happen, and it *is* sort of a big deal. Looking at it some more, one
will note there is a glaring hole in the deferred CPU selection:
(w/ CONFIG_CPUSET=n, so that the affinity mask passed via taskset doesn't
get AND'd with cpu_online_mask)
$ taskset -pc 0-2 $PID
# offline CPUs 3-4
$ taskset -pc 3-5 $PID
`\
$PID may stay on 0-2 due to the cpumask_any_distribute() picking an
offline CPU and __migrate_task() refusing to do anything due to
cpu_is_allowed().
set_cpus_allowed_ptr() goes to some length to pick a dest_cpu that matches
the right constraints vs affinity and the online/active state of the
CPUs. Reuse that instead of discarding it in the affine_move_task() case.
Fixes: 6d337eab041d ("sched: Fix migrate_disable() vs set_cpus_allowed_ptr()")
Reported-by: Will Deacon <will@kernel.org>
Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210526205751.842360-2-valentin.schneider@arm.com
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions