Skip to content

Commit

Permalink
sched: Make sure timers have migrated before killing the migration_th…
Browse files Browse the repository at this point in the history
…read

Problem: In a stress test where some heavy tests were running along with
regular CPU offlining and onlining, a hang was observed. The system seems
to be hung at a point where migration_call() tries to kill the
migration_thread of the dying CPU, which just got moved to the current
CPU. This migration thread does not get a chance to run (and die) since
rt_throttled is set to 1 on current, and it doesn't get cleared as the
hrtimer which is supposed to reset the rt bandwidth
(sched_rt_period_timer) is tied to the CPU which we just marked dead!

Solution: This patch pushes the killing of migration thread to
"CPU_POST_DEAD" event. By then all the timers (including
sched_rt_period_timer) should have got migrated (along with other
callbacks).

Signed-off-by: Amit Arora <[email protected]>
Signed-off-by: Gautham R Shenoy <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Amit K. Arora authored and Ingo Molnar committed May 31, 2010
1 parent 67a3e12 commit 54e88fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/stop_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static int __cpuinit cpu_stop_cpu_callback(struct notifier_block *nfb,

#ifdef CONFIG_HOTPLUG_CPU
case CPU_UP_CANCELED:
case CPU_DEAD:
case CPU_POST_DEAD:
{
struct cpu_stop_work *work;

Expand Down

0 comments on commit 54e88fa

Please sign in to comment.