diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-10 14:25:03 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-07-10 14:39:58 -0400 |
| commit | b1e387348a2a70954312b102d0589c3e2ca3dba1 (patch) | |
| tree | 79e11e0b1bda79e6e2b085b9d86eb3b9d9dedf29 | |
| parent | dc7fab8b3bb388c57c6c4a43ba68c8a32ca25204 (diff) | |
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) | |||
| 5621 | 5621 | ||
| 5622 | double_rq_lock(rq_src, rq_dest); | 5622 | double_rq_lock(rq_src, rq_dest); |
| 5623 | /* Already moved. */ | 5623 | /* Already moved. */ |
| 5624 | if (task_cpu(p) != src_cpu) { | 5624 | if (task_cpu(p) != src_cpu) |
| 5625 | ret = 1; | 5625 | goto done; |
| 5626 | goto out; | ||
| 5627 | } | ||
| 5628 | /* Affinity changed (again). */ | 5626 | /* Affinity changed (again). */ |
| 5629 | if (!cpu_isset(dest_cpu, p->cpus_allowed)) | 5627 | if (!cpu_isset(dest_cpu, p->cpus_allowed)) |
| 5630 | goto out; | 5628 | goto fail; |
| 5631 | 5629 | ||
| 5632 | on_rq = p->se.on_rq; | 5630 | on_rq = p->se.on_rq; |
| 5633 | if (on_rq) | 5631 | if (on_rq) |
| @@ -5638,8 +5636,9 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) | |||
| 5638 | activate_task(rq_dest, p, 0); | 5636 | activate_task(rq_dest, p, 0); |
| 5639 | check_preempt_curr(rq_dest, p); | 5637 | check_preempt_curr(rq_dest, p); |
| 5640 | } | 5638 | } |
| 5639 | done: | ||
| 5641 | ret = 1; | 5640 | ret = 1; |
| 5642 | out: | 5641 | fail: |
| 5643 | double_rq_unlock(rq_src, rq_dest); | 5642 | double_rq_unlock(rq_src, rq_dest); |
| 5644 | return ret; | 5643 | return ret; |
| 5645 | } | 5644 | } |
