Commit b1e38734 authored by Linus Torvalds's avatar Linus Torvalds Committed by Ingo Molnar

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: default avatarIngo Molnar <mingo@elte.hu>
parent dc7fab8b
...@@ -5621,13 +5621,11 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) ...@@ -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); double_rq_lock(rq_src, rq_dest);
/* Already moved. */ /* Already moved. */
if (task_cpu(p) != src_cpu) { if (task_cpu(p) != src_cpu)
ret = 1; goto done;
goto out;
}
/* Affinity changed (again). */ /* Affinity changed (again). */
if (!cpu_isset(dest_cpu, p->cpus_allowed)) if (!cpu_isset(dest_cpu, p->cpus_allowed))
goto out; goto fail;
on_rq = p->se.on_rq; on_rq = p->se.on_rq;
if (on_rq) if (on_rq)
...@@ -5638,8 +5636,9 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu) ...@@ -5638,8 +5636,9 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
activate_task(rq_dest, p, 0); activate_task(rq_dest, p, 0);
check_preempt_curr(rq_dest, p); check_preempt_curr(rq_dest, p);
} }
done:
ret = 1; ret = 1;
out: fail:
double_rq_unlock(rq_src, rq_dest); double_rq_unlock(rq_src, rq_dest);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment