sched: Simplify cpu-hot-unplug task migration
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Sat, 13 Nov 2010 18:32:29 +0000 (19:32 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 18 Nov 2010 12:27:46 +0000 (13:27 +0100)
commit48c5ccae88dcd989d9de507e8510313c6cbd352b
tree06fe8ce2ac28e9f5844de8bc32ecbef97e40d68b
parent92fd4d4d67b945c0766416284d4ab236b31542c4
sched: Simplify cpu-hot-unplug task migration

While discussing the need for sched_idle_next(), Oleg remarked that
since try_to_wake_up() ensures sleeping tasks will end up running on a
sane cpu, we can do away with migrate_live_tasks().

If we then extend the existing hack of migrating current from
CPU_DYING to migrating the full rq worth of tasks from CPU_DYING, the
need for the sched_idle_next() abomination disappears as well, since
idle will be the only possible thread left after the migration thread
stops.

This greatly simplifies the hot-unplug task migration path, as can be
seen from the resulting code reduction (and about half the new lines
are comments).

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1289851597.2109.547.camel@laptop>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/sched.h
kernel/cpu.c
kernel/sched.c