aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c11
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 */
115static unsigned long get_timestamp(int this_cpu) 116static 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
120static void set_sample_period(void) 121static 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 */
133static void __touch_watchdog(void) 134static 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
140void touch_softlockup_watchdog(void) 139void touch_softlockup_watchdog(void)
@@ -195,7 +194,7 @@ static int is_hardlockup(void)
195 194
196static int is_softlockup(unsigned long touch_ts) 195static 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()))