diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2012-03-01 13:55:28 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-03-02 11:52:34 -0600 |
commit | 9c393e907d040c434eccaf2af511a6b56f009a63 (patch) | |
tree | 94b5148821b0da428d63a71f9c182b7d874849ff /kernel/timer.c | |
parent | d1b3d4da414d3eb6d32d69356aa03b63c5b96d57 (diff) |
timer: Fix hotplug for -rt
Revert the RT patch:
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Jul 3 08:30:32 2009 -0500
timers: fix timer hotplug on -rt
Here we are in the CPU_DEAD notifier, and we must not sleep nor
enable interrupts.
There's no problem with sleeping in this notifier.
But the get_cpu_var() had to be converted to a get_local_var().
Replace the previous fix with the get_local_var() convert.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Carsten Emde <C.Emde@osadl.org>
Cc: John Kacur <jkacur@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Clark Williams <clark.williams@gmail.com>
Cc: stable-rt@vger.kernel.org
Link: http://lkml.kernel.org/r/20120301190344.948157137@goodmis.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index a791a43799b0..c8c88d115aa7 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1743,21 +1743,17 @@ static void __cpuinit migrate_timers(int cpu) { struct tvec_base *old_base; struct tvec_base *new_base; - unsigned long flags; int i; BUG_ON(cpu_online(cpu)); old_base = per_cpu(tvec_bases, cpu); - new_base = get_cpu_var(tvec_bases); + new_base = get_local_var(tvec_bases); /* * The caller is globally serialized and nobody else * takes two locks at once, deadlock is not possible. */ - local_irq_save(flags); - while (!spin_trylock(&new_base->lock)) - cpu_relax(); - while (!spin_trylock(&old_base->lock)) - cpu_relax(); + spin_lock_irq(&new_base->lock); + spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); BUG_ON(old_base->running_timer); @@ -1771,10 +1767,8 @@ static void __cpuinit migrate_timers(int cpu) } spin_unlock(&old_base->lock); - spin_unlock(&new_base->lock); - local_irq_restore(flags); - - put_cpu_var(tvec_bases); + spin_unlock_irq(&new_base->lock); + put_local_var(tvec_bases); } #endif /* CONFIG_HOTPLUG_CPU */ |