diff options
author | Peter Zijlstra <peterz@infradead.org> | 2015-10-09 18:36:29 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-10-20 10:25:56 +0200 |
commit | 62694cd51322262a9142e946915fc4783113ccff (patch) | |
tree | afcbbd408026ef603f6831fce8867b73601d77ec /kernel/sched/core.c | |
parent | 07f06cb3b5f6bd21374a48dbefdb431d71d53974 (diff) | |
download | talos-obmc-linux-62694cd51322262a9142e946915fc4783113ccff.tar.gz talos-obmc-linux-62694cd51322262a9142e946915fc4783113ccff.zip |
sched: Move cpu_active() tests from stop_two_cpus() into migrate_swap_stop()
The cpu_active() tests are not fundamentally part of stop_two_cpus(),
move then into the scheduler where they belong.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r-- | kernel/sched/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 7ee8caea1195..a7b368e51f69 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -1335,12 +1335,16 @@ static int migrate_swap_stop(void *data) struct rq *src_rq, *dst_rq; int ret = -EAGAIN; + if (!cpu_active(arg->src_cpu) || !cpu_active(arg->dst_cpu)) + return -EAGAIN; + src_rq = cpu_rq(arg->src_cpu); dst_rq = cpu_rq(arg->dst_cpu); double_raw_lock(&arg->src_task->pi_lock, &arg->dst_task->pi_lock); double_rq_lock(src_rq, dst_rq); + if (task_cpu(arg->dst_task) != arg->dst_cpu) goto unlock; |