]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
softlockup: use cpu_clock() instead of sched_clock()
authorIngo Molnar <mingo@elte.hu>
Wed, 17 Oct 2007 06:26:06 +0000 (23:26 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Nov 2007 17:42:32 +0000 (09:42 -0800)
patch a3b13c23f186ecb57204580cc1f2dbe9c284953a in mainline.

sched_clock() is not a reliable time-source, use cpu_clock() instead.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/softlockup.c

index def081b8a5b3e89f5a71d95430a9c67f554fb996..d857bb0616ad425d23ebfe3d1c3b134681195ad4 100644 (file)
@@ -43,14 +43,16 @@ static struct notifier_block panic_block = {
  * resolution, and we don't need to waste time with a big divide when
  * 2^30ns == 1.074s.
  */
-static unsigned long get_timestamp(void)
+static unsigned long get_timestamp(int this_cpu)
 {
-       return sched_clock() >> 30;  /* 2^30 ~= 10^9 */
+       return cpu_clock(this_cpu) >> 30;  /* 2^30 ~= 10^9 */
 }
 
 void touch_softlockup_watchdog(void)
 {
-       __raw_get_cpu_var(touch_timestamp) = get_timestamp();
+       int this_cpu = raw_smp_processor_id();
+
+       __raw_get_cpu_var(touch_timestamp) = get_timestamp(this_cpu);
 }
 EXPORT_SYMBOL(touch_softlockup_watchdog);
 
@@ -96,7 +98,7 @@ void softlockup_tick(void)
                return;
        }
 
-       now = get_timestamp();
+       now = get_timestamp(this_cpu);
 
        /* Wake up the high-prio watchdog task every second: */
        if (now > (touch_timestamp + 1))