diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-10 20:25:03 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-10 20:39:58 +0200 |
commit | b1e387348a2a70954312b102d0589c3e2ca3dba1 (patch) | |
tree | 79e11e0b1bda79e6e2b085b9d86eb3b9d9dedf29 | |
parent | sched: fix cpu hotplug (diff) | |
download | linux-b1e387348a2a70954312b102d0589c3e2ca3dba1.tar.xz linux-b1e387348a2a70954312b102d0589c3e2ca3dba1.zip |
sched: fix cpu hotplug, cleanup
Clean up __migrate_task(): to just have separate "done" and "fail"
cases, instead of that "out" case with random error behavior.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/sched.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 9397b8710138..4e2f60335656 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -5621,13 +5621,11 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) double_rq_lock(rq_src, rq_dest); /* Already moved. */ - if (task_cpu(p) != src_cpu) { - ret = 1; - goto out; - } + if (task_cpu(p) != src_cpu) + goto done; /* Affinity changed (again). */ if (!cpu_isset(dest_cpu, p->cpus_allowed)) - goto out; + goto fail; on_rq = p->se.on_rq; if (on_rq) @@ -5638,8 +5636,9 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) activate_task(rq_dest, p, 0); check_preempt_curr(rq_dest, p); } +done: ret = 1; -out: +fail: double_rq_unlock(rq_src, rq_dest); return ret; } |