aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-04-04 14:54:10 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-04-17 06:22:31 -0400
commit8e60e05fdc7344415fa69a3883b11f65db967b47 (patch)
treea0b13c31670221906e8d48cb7bf47dc8f8043918 /kernel/hrtimer.c
parent0d180406f2914aea3a78ddb880e2fe9ac78a9372 (diff)
hrtimers: simplify lockdep handling
In order to avoid the false positive from lockdep, each per-cpu base->lock has the separate lock class and migrate_hrtimers() uses double_spin_lock(). This is overcomplicated: except for migrate_hrtimers() we never take 2 locks at once, and migrate_hrtimers() can use spin_lock_nested(). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 911e87d0440d..c642ef75069f 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1424,7 +1424,6 @@ static void __cpuinit init_hrtimers_cpu(int cpu)
1424 int i; 1424 int i;
1425 1425
1426 spin_lock_init(&cpu_base->lock); 1426 spin_lock_init(&cpu_base->lock);
1427 lockdep_set_class(&cpu_base->lock, &cpu_base->lock_key);
1428 1427
1429 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) 1428 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++)
1430 cpu_base->clock_base[i].cpu_base = cpu_base; 1429 cpu_base->clock_base[i].cpu_base = cpu_base;
@@ -1465,16 +1464,16 @@ static void migrate_hrtimers(int cpu)
1465 tick_cancel_sched_timer(cpu); 1464 tick_cancel_sched_timer(cpu);
1466 1465
1467 local_irq_disable(); 1466 local_irq_disable();
1468 double_spin_lock(&new_base->lock, &old_base->lock, 1467 spin_lock(&new_base->lock);
1469 smp_processor_id() < cpu); 1468 spin_lock_nested(&old_base->lock, SINGLE_DEPTH_NESTING);
1470 1469
1471 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { 1470 for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
1472 migrate_hrtimer_list(&old_base->clock_base[i], 1471 migrate_hrtimer_list(&old_base->clock_base[i],
1473 &new_base->clock_base[i]); 1472 &new_base->clock_base[i]);
1474 } 1473 }
1475 1474
1476 double_spin_unlock(&new_base->lock, &old_base->lock, 1475 spin_unlock(&old_base->lock);
1477 smp_processor_id() < cpu); 1476 spin_unlock(&new_base->lock);
1478 local_irq_enable(); 1477 local_irq_enable();
1479 put_cpu_var(hrtimer_bases); 1478 put_cpu_var(hrtimer_bases);
1480} 1479}