Merge branch 'sched/clock' into tracing/ftrace
authorIngo Molnar <mingo@elte.hu>
Thu, 26 Feb 2009 20:21:59 +0000 (21:21 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Feb 2009 20:21:59 +0000 (21:21 +0100)
Conflicts:
kernel/sched_clock.c

1  2 
include/linux/sched.h
kernel/sched_clock.c

Simple merge
   * The clock: sched_clock_cpu() is monotonic per cpu, and should be somewhat
   * consistent between cpus (never more than 2 jiffies difference).
   */
- #include <linux/sched.h>
- #include <linux/percpu.h>
  #include <linux/spinlock.h>
- #include <linux/ktime.h>
- #include <linux/module.h>
 +#include <linux/hardirq.h>
+ #include <linux/module.h>
+ #include <linux/percpu.h>
+ #include <linux/ktime.h>
+ #include <linux/sched.h>
  
  /*
   * Scheduler clock - returns current time in nanosec units.
@@@ -149,19 -155,13 +156,23 @@@ static void lock_double_clock(struct sc
  
  u64 sched_clock_cpu(int cpu)
  {
-       struct sched_clock_data *scd = cpu_sdc(cpu);
        u64 now, clock, this_clock, remote_clock;
+       struct sched_clock_data *scd;
+       if (sched_clock_stable)
+               return sched_clock();
  
 +      /*
 +       * Normally this is not called in NMI context - but if it is,
 +       * trying to do any locking here is totally lethal.
 +       */
 +      if (unlikely(in_nmi()))
 +              return scd->clock;
 +
 +      if (unlikely(!sched_clock_running))
 +              return 0ull;
 +
+       scd = cpu_sdc(cpu);
        WARN_ON_ONCE(!irqs_disabled());
        now = sched_clock();