From: Ingo Molnar Found a hotplug-CPU removal related bug in the dynticks code: the sched tick hrtimer needs to be deactivated, otherwise it will be migrated to another CPU's hrtimers queue and might confuse the high-res timers code there. The bug was found via lockdep - the bug itself didnt cause an actual crash or other regression - nevertheless we want to fix it. The lockdep message was: ===================================== [ BUG: bad unlock balance detected! ] ------------------------------------- swapper/0 is trying to release lock (cpu1_base->lock) at: [] hrtimer_sched_tick+0x5b/0xac but there are no more locks to release! other info that might help us debug this: 1 lock held by swapper/0: #0: (cpu0_base->lock){+...}, at: [] hrtimer_interrupt+0x73/0x1a8 stack backtrace: Call Trace: [] dump_trace+0xaa/0x406 [] show_trace+0x3a/0x60 [] dump_stack+0x15/0x17 [] print_unlock_inbalance_bug+0x108/0x118 [] lock_release_non_nested+0x81/0x121 [] lock_release+0x11c/0x13e [] __spin_unlock+0x1b/0x4b [] hrtimer_sched_tick+0x5b/0xac [] hrtimer_interrupt+0x113/0x1a8 [] smp_apic_timer_interrupt+0x66/0x82 [] apic_timer_interrupt+0x6b/0x70 [] default_idle+0x4a/0x7c [] cpu_idle+0xb0/0x109 [] rest_init+0x49/0x4b [] start_kernel+0x28a/0x28c [] _sinittext+0x16f/0x176 Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton --- kernel/hrtimer.c | 5 +++++ 1 files changed, 5 insertions(+) diff -puN kernel/hrtimer.c~updated-dynticks-core-code-fix-resume-bug kernel/hrtimer.c --- a/kernel/hrtimer.c~updated-dynticks-core-code-fix-resume-bug +++ a/kernel/hrtimer.c @@ -1709,6 +1709,11 @@ static void migrate_hrtimers(int cpu) old_base = &per_cpu(hrtimer_bases, cpu); new_base = &get_cpu_var(hrtimer_bases); +#ifdef CONFIG_HIGH_RES_TIMERS + if (old_base->hres_active) + hrtimer_cancel(&old_base->sched_timer); +#endif + local_irq_disable(); spin_lock(&new_base->lock); _