History

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

Linus Torvalds committed 16 years ago

Commit 3cd312c2 parents ecd5907 cf1e3672 files · +15 −5Browse files

Unified · Split

2 files
  1. kernel/time/clockevents.c +15 −3
  2. kernel/timer.c +0 −2
kernel/time/clockevents.c+15−3
@@ -238,8 +238,9 @@ void clockevents_exchange_device(struct clock_event_device *old, · 237 unmodified lines
238238 */
239239 void clockevents_notify(unsigned long reason, void *arg)
240240 {
241− struct list_head *node, *tmp;
241+ struct clock_event_device *dev, *tmp;
242242 unsigned long flags;
243+ int cpu;
243244
244245 raw_spin_lock_irqsave(&clockevents_lock, flags);
245246 clockevents_do_notify(reason, arg);
@@ -250,8 +251,19 @@ void clockevents_notify(unsigned long reason, void *arg) · 4 unmodified lines
250251 * Unregister the clock event devices which were
251252 * released from the users in the notify chain.
252253 */
253− list_for_each_safe(node, tmp, &clockevents_released)
254− list_del(node);
254+ list_for_each_entry_safe(dev, tmp, &clockevents_released, list)
255+ list_del(&dev->list);
256+ /*
257+ * Now check whether the CPU has left unused per cpu devices
258+ */
259+ cpu = *((int *)arg);
260+ list_for_each_entry_safe(dev, tmp, &clockevent_devices, list) {
261+ if (cpumask_test_cpu(cpu, dev->cpumask) &&
262+ cpumask_weight(dev->cpumask) == 1) {
263+ BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
264+ list_del(&dev->list);
265+ }
266+ }
255267 break;
256268 default:
257269 break;
kernel/timer.c+0−2
@@ -656,8 +656,6 @@ __mod_timer(struct timer_list *timer, unsigned long expires, · 655 unmodified lines
656656
657657 debug_activate(timer, expires);
658658
659− new_base = __get_cpu_var(tvec_bases);
660−
661659 cpu = smp_processor_id();
662660
663661 #if defined(CONFIG_NO_HZ) && defined(CONFIG_SMP)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t