aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-01-05 05:28:21 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-05 07:14:33 -0500
commit731a55ba0f17064f85903b7bf8e24849ec6cfa20 (patch)
treee81c1b2c486250460c8850be4da8c320d23b84ba /kernel/hrtimer.c
parentd5fd43c4ae04523e1dcd7794f9c511b289851350 (diff)
hrtimer: simplify hotplug migration
Impact: cleanup No need for a smp function call, which is likely to run on the same CPU anyway. We can just call hrtimers_peek_ahead() in the interrupts disabled section of migrate_hrtimers(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 9c2bfa841281..8010a67cead0 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1504,11 +1504,6 @@ static void __cpuinit init_hrtimers_cpu(int cpu)
1504 1504
1505#ifdef CONFIG_HOTPLUG_CPU 1505#ifdef CONFIG_HOTPLUG_CPU
1506 1506
1507static void tickle_timers(void *arg)
1508{
1509 hrtimer_peek_ahead_timers();
1510}
1511
1512static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, 1507static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
1513 struct hrtimer_clock_base *new_base) 1508 struct hrtimer_clock_base *new_base)
1514{ 1509{
@@ -1547,20 +1542,19 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base,
1547static void migrate_hrtimers(int scpu) 1542static void migrate_hrtimers(int scpu)
1548{ 1543{
1549 struct hrtimer_cpu_base *old_base, *new_base; 1544 struct hrtimer_cpu_base *old_base, *new_base;
1550 int dcpu, i; 1545 int i;
1551 1546
1552 BUG_ON(cpu_online(scpu)); 1547 BUG_ON(cpu_online(scpu));
1553 old_base = &per_cpu(hrtimer_bases, scpu);
1554 new_base = &get_cpu_var(hrtimer_bases);
1555
1556 dcpu = smp_processor_id();
1557
1558 tick_cancel_sched_timer(scpu); 1548 tick_cancel_sched_timer(scpu);
1549
1550 local_irq_disable();
1551 old_base = &per_cpu(hrtimer_bases, scpu);
1552 new_base = &__get_cpu_var(hrtimer_bases);
1559 /* 1553 /*
1560 * The caller is globally serialized and nobody else 1554 * The caller is globally serialized and nobody else
1561 * takes two locks at once, deadlock is not possible. 1555 * takes two locks at once, deadlock is not possible.
1562 */ 1556 */
1563 spin_lock_irq(&new_base->lock); 1557 spin_lock(&new_base->lock);
1564 spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING); 1558 spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
1565 1559
1566 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { 1560 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
@@ -1569,10 +1563,11 @@ static void migrate_hrtimers(int scpu)
1569 } 1563 }
1570 1564
1571 spin_unlock(&old_base->lock); 1565 spin_unlock(&old_base->lock);
1572 spin_unlock_irq(&new_base->lock); 1566 spin_unlock(&new_base->lock);
1573 put_cpu_var(hrtimer_bases);
1574 1567
1575 smp_call_function_single(dcpu, tickle_timers, NULL, 0); 1568 /* Check, if we got expired work to do */
1569 __hrtimer_peek_ahead_timers();
1570 local_irq_enable();
1576} 1571}
1577 1572
1578#endif /* CONFIG_HOTPLUG_CPU */ 1573#endif /* CONFIG_HOTPLUG_CPU */