Merge git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 18 Apr 2008 15:37:41 +0000 (08:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 18 Apr 2008 15:37:41 +0000 (08:37 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-hrt:
  clocksource: make clocksource watchdog cycle through online CPUs
  Documentation: move timer related documentation to a single place
  clockevents: optimise tick_nohz_stop_sched_tick() a bit
  locking: remove unused double_spin_lock()
  hrtimers: simplify lockdep handling
  timers: simplify lockdep handling
  posix-timers: fix shadowed variables
  timer_list: add annotations to workqueue.c
  hrtimer: use nanosleep specific restart_block fields
  hrtimer: add nanosleep specific restart_block member

1  2 
kernel/time/clocksource.c

index f61402b1f2d0791e89078bdac94321a69bad4253,912156dd600555a2dd6be6861a80de577b3c9947..73961f35fdc84ba1ba28251bb4115f52b094d908
@@@ -141,8 -141,16 +141,16 @@@ static void clocksource_watchdog(unsign
        }
  
        if (!list_empty(&watchdog_list)) {
-               __mod_timer(&watchdog_timer,
-                           watchdog_timer.expires + WATCHDOG_INTERVAL);
+               /*
+                * Cycle through CPUs to check if the CPUs stay
+                * synchronized to each other.
+                */
+               int next_cpu = next_cpu(raw_smp_processor_id(), cpu_online_map);
+               if (next_cpu >= NR_CPUS)
+                       next_cpu = first_cpu(cpu_online_map);
+               watchdog_timer.expires += WATCHDOG_INTERVAL;
+               add_timer_on(&watchdog_timer, next_cpu);
        }
        spin_unlock(&watchdog_lock);
  }
@@@ -164,7 -172,8 +172,8 @@@ static void clocksource_check_watchdog(
                if (!started && watchdog) {
                        watchdog_last = watchdog->read();
                        watchdog_timer.expires = jiffies + WATCHDOG_INTERVAL;
-                       add_timer(&watchdog_timer);
+                       add_timer_on(&watchdog_timer,
+                                    first_cpu(cpu_online_map));
                }
        } else {
                if (cs->flags & CLOCK_SOURCE_IS_CONTINUOUS)
                                watchdog_last = watchdog->read();
                                watchdog_timer.expires =
                                        jiffies + WATCHDOG_INTERVAL;
-                               add_timer(&watchdog_timer);
+                               add_timer_on(&watchdog_timer,
+                                            first_cpu(cpu_online_map));
                        }
                }
        }
@@@ -221,18 -231,6 +231,18 @@@ void clocksource_resume(void
        spin_unlock_irqrestore(&clocksource_lock, flags);
  }
  
 +/**
 + * clocksource_touch_watchdog - Update watchdog
 + *
 + * Update the watchdog after exception contexts such as kgdb so as not
 + * to incorrectly trip the watchdog.
 + *
 + */
 +void clocksource_touch_watchdog(void)
 +{
 +      clocksource_resume_watchdog();
 +}
 +
  /**
   * clocksource_get_next - Returns the selected clocksource
   *