diff --git a/kernel/watchdog_hld.c b/kernel/watchdog_hld.c index cb7053a6ba495295e5542ca2a8fc1da0f7f02081..e4f158f56eda97a261cf4de4a5abfd77a162e955 100644 --- a/kernel/watchdog_hld.c +++ b/kernel/watchdog_hld.c @@ -290,11 +290,15 @@ void refresh_hld_last_timestamp(void) __this_cpu_write(last_timestamp, now); } -#else -static inline bool watchdog_check_timestamp(void) + +static void watchdog_init_timestamp(void) { - return true; + __this_cpu_write(nmi_rearmed, 0); + __this_cpu_write(last_timestamp, ktime_get_mono_fast_ns()); } +#else +static inline bool watchdog_check_timestamp(void) { return true; } +static inline void watchdog_init_timestamp(void) { } #endif void watchdog_hardlockup_check(struct pt_regs *regs) @@ -416,6 +420,7 @@ void hardlockup_detector_perf_enable(void) if (!atomic_fetch_inc(&watchdog_cpus)) pr_info("Enabled. Permanently consumes one hw-PMU counter.\n"); + watchdog_init_timestamp(); perf_event_enable(this_cpu_read(watchdog_ev)); }