Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
timers: Remove duplicate setting of new_base in __mod_timer()
clockevents: Prevent clockevent_devices list corruption on cpu hotplug

+15 -5
+15 -3
kernel/time/clockevents.c
··· 238 238 */ 239 239 void clockevents_notify(unsigned long reason, void *arg) 240 240 { 241 - struct list_head *node, *tmp; 241 + struct clock_event_device *dev, *tmp; 242 242 unsigned long flags; 243 + int cpu; 243 244 244 245 raw_spin_lock_irqsave(&clockevents_lock, flags); 245 246 clockevents_do_notify(reason, arg); ··· 251 250 * Unregister the clock event devices which were 252 251 * released from the users in the notify chain. 253 252 */ 254 - list_for_each_safe(node, tmp, &clockevents_released) 255 - list_del(node); 253 + list_for_each_entry_safe(dev, tmp, &clockevents_released, list) 254 + list_del(&dev->list); 255 + /* 256 + * Now check whether the CPU has left unused per cpu devices 257 + */ 258 + cpu = *((int *)arg); 259 + list_for_each_entry_safe(dev, tmp, &clockevent_devices, list) { 260 + if (cpumask_test_cpu(cpu, dev->cpumask) && 261 + cpumask_weight(dev->cpumask) == 1) { 262 + BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); 263 + list_del(&dev->list); 264 + } 265 + } 256 266 break; 257 267 default: 258 268 break;
-2
kernel/timer.c
··· 656 656 657 657 debug_activate(timer, expires); 658 658 659 - new_base = __get_cpu_var(tvec_bases); 660 - 661 659 cpu = smp_processor_id(); 662 660 663 661 #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)