diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-10-17 02:26:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:46 -0400 |
commit | a3b13c23f186ecb57204580cc1f2dbe9c284953a (patch) | |
tree | 7f7b1de1c0c7e45b6dfc91b1d09639aaf1051291 | |
parent | 3806204ca9017a2cf2d849430f26e2b62666f5b2 (diff) |
softlockup: use cpu_clock() instead of sched_clock()
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>
-rw-r--r-- | kernel/softlockup.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/softlockup.c b/kernel/softlockup.c index 708d4882c0c3..68f7606b4160 100644 --- a/kernel/softlockup.c +++ b/kernel/softlockup.c | |||
@@ -40,14 +40,16 @@ static struct notifier_block panic_block = { | |||
40 | * resolution, and we don't need to waste time with a big divide when | 40 | * resolution, and we don't need to waste time with a big divide when |
41 | * 2^30ns == 1.074s. | 41 | * 2^30ns == 1.074s. |
42 | */ | 42 | */ |
43 | static unsigned long get_timestamp(void) | 43 | static unsigned long get_timestamp(int this_cpu) |
44 | { | 44 | { |
45 | return sched_clock() >> 30; /* 2^30 ~= 10^9 */ | 45 | return cpu_clock(this_cpu) >> 30; /* 2^30 ~= 10^9 */ |
46 | } | 46 | } |
47 | 47 | ||
48 | void touch_softlockup_watchdog(void) | 48 | void touch_softlockup_watchdog(void) |
49 | { | 49 | { |
50 | __raw_get_cpu_var(touch_timestamp) = get_timestamp(); | 50 | int this_cpu = raw_smp_processor_id(); |
51 | |||
52 | __raw_get_cpu_var(touch_timestamp) = get_timestamp(this_cpu); | ||
51 | } | 53 | } |
52 | EXPORT_SYMBOL(touch_softlockup_watchdog); | 54 | EXPORT_SYMBOL(touch_softlockup_watchdog); |
53 | 55 | ||
@@ -91,7 +93,7 @@ void softlockup_tick(void) | |||
91 | return; | 93 | return; |
92 | } | 94 | } |
93 | 95 | ||
94 | now = get_timestamp(); | 96 | now = get_timestamp(this_cpu); |
95 | 97 | ||
96 | /* Wake up the high-prio watchdog task every second: */ | 98 | /* Wake up the high-prio watchdog task every second: */ |
97 | if (now > (touch_timestamp + 1)) | 99 | if (now > (touch_timestamp + 1)) |