diff options
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r-- | kernel/watchdog.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 75a2ab3d0b02..4a944676358e 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/module.h> | 23 | #include <linux/module.h> |
24 | #include <linux/sysctl.h> | 24 | #include <linux/sysctl.h> |
25 | #include <linux/smpboot.h> | 25 | #include <linux/smpboot.h> |
26 | #include <linux/sched/rt.h> | ||
26 | 27 | ||
27 | #include <asm/irq_regs.h> | 28 | #include <asm/irq_regs.h> |
28 | #include <linux/kvm_para.h> | 29 | #include <linux/kvm_para.h> |
@@ -112,9 +113,9 @@ static int get_softlockup_thresh(void) | |||
112 | * resolution, and we don't need to waste time with a big divide when | 113 | * resolution, and we don't need to waste time with a big divide when |
113 | * 2^30ns == 1.074s. | 114 | * 2^30ns == 1.074s. |
114 | */ | 115 | */ |
115 | static unsigned long get_timestamp(int this_cpu) | 116 | static unsigned long get_timestamp(void) |
116 | { | 117 | { |
117 | return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */ | 118 | return local_clock() >> 30LL; /* 2^30 ~= 10^9 */ |
118 | } | 119 | } |
119 | 120 | ||
120 | static void set_sample_period(void) | 121 | static void set_sample_period(void) |
@@ -132,9 +133,7 @@ static void set_sample_period(void) | |||
132 | /* Commands for resetting the watchdog */ | 133 | /* Commands for resetting the watchdog */ |
133 | static void __touch_watchdog(void) | 134 | static void __touch_watchdog(void) |
134 | { | 135 | { |
135 | int this_cpu = smp_processor_id(); | 136 | __this_cpu_write(watchdog_touch_ts, get_timestamp()); |
136 | |||
137 | __this_cpu_write(watchdog_touch_ts, get_timestamp(this_cpu)); | ||
138 | } | 137 | } |
139 | 138 | ||
140 | void touch_softlockup_watchdog(void) | 139 | void touch_softlockup_watchdog(void) |
@@ -195,7 +194,7 @@ static int is_hardlockup(void) | |||
195 | 194 | ||
196 | static int is_softlockup(unsigned long touch_ts) | 195 | static int is_softlockup(unsigned long touch_ts) |
197 | { | 196 | { |
198 | unsigned long now = get_timestamp(smp_processor_id()); | 197 | unsigned long now = get_timestamp(); |
199 | 198 | ||
200 | /* Warn about unreasonable delays: */ | 199 | /* Warn about unreasonable delays: */ |
201 | if (time_after(now, touch_ts + get_softlockup_thresh())) | 200 | if (time_after(now, touch_ts + get_softlockup_thresh())) |