Skip to content

Commit b1e3873

Browse files
torvaldsIngo Molnar
authored andcommitted
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 <[email protected]>
1 parent dc7fab8 commit b1e3873

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

kernel/sched.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5621,13 +5621,11 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
56215621

56225622
double_rq_lock(rq_src, rq_dest);
56235623
/* Already moved. */
5624-
if (task_cpu(p) != src_cpu) {
5625-
ret = 1;
5626-
goto out;
5627-
}
5624+
if (task_cpu(p) != src_cpu)
5625+
goto done;
56285626
/* Affinity changed (again). */
56295627
if (!cpu_isset(dest_cpu, p->cpus_allowed))
5630-
goto out;
5628+
goto fail;
56315629

56325630
on_rq = p->se.on_rq;
56335631
if (on_rq)
@@ -5638,8 +5636,9 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
56385636
activate_task(rq_dest, p, 0);
56395637
check_preempt_curr(rq_dest, p);
56405638
}
5639+
done:
56415640
ret = 1;
5642-
out:
5641+
fail:
56435642
double_rq_unlock(rq_src, rq_dest);
56445643
return ret;
56455644
}

0 commit comments

Comments
 (0)