From: Ingo Molnar sched_clock() is not a reliable time-source, use cpu_clock() instead. Signed-off-by: Ingo Molnar Signed-off-by: Andrew Morton --- kernel/softlockup.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff -puN kernel/softlockup.c~softlockup-use-cpu_clock-instead-of-sched_clock kernel/softlockup.c --- a/kernel/softlockup.c~softlockup-use-cpu_clock-instead-of-sched_clock +++ a/kernel/softlockup.c @@ -41,18 +41,20 @@ 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) { + int this_cpu = raw_smp_processor_id(); + #ifdef CONFIG_KGDB - if (unlikely(kgdb_softlock_skip[smp_processor_id()])) - kgdb_softlock_skip[smp_processor_id()] = 0; + if (unlikely(kgdb_softlock_skip[this_cpu])) + kgdb_softlock_skip[this_cpu] = 0; #endif - __raw_get_cpu_var(touch_timestamp) = get_timestamp(); + per_cpu(touch_timestamp, this_cpu) = 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)) _