Skip to content

Commit

Permalink
Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Dec 19, 2009
2 parents ecd5907 + cf1e367 commit 3cd312c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 15 additions & 3 deletions kernel/time/clockevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ void clockevents_exchange_device(struct clock_event_device *old,
*/
void clockevents_notify(unsigned long reason, void *arg)
{
struct list_head *node, *tmp;
struct clock_event_device *dev, *tmp;
unsigned long flags;
int cpu;

raw_spin_lock_irqsave(&clockevents_lock, flags);
clockevents_do_notify(reason, arg);
Expand All @@ -250,8 +251,19 @@ void clockevents_notify(unsigned long reason, void *arg)
* Unregister the clock event devices which were
* released from the users in the notify chain.
*/
list_for_each_safe(node, tmp, &clockevents_released)
list_del(node);
list_for_each_entry_safe(dev, tmp, &clockevents_released, list)
list_del(&dev->list);
/*
* Now check whether the CPU has left unused per cpu devices
*/
cpu = *((int *)arg);
list_for_each_entry_safe(dev, tmp, &clockevent_devices, list) {
if (cpumask_test_cpu(cpu, dev->cpumask) &&
cpumask_weight(dev->cpumask) == 1) {
BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
list_del(&dev->list);
}
}
break;
default:
break;
Expand Down
2 changes: 0 additions & 2 deletions kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,6 @@ __mod_timer(struct timer_list *timer, unsigned long expires,

debug_activate(timer, expires);

new_base = __get_cpu_var(tvec_bases);

cpu = smp_processor_id();

#if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)
Expand Down

0 comments on commit 3cd312c

Please sign in to comment.