From 88701af1c9d9bdfd0781a947e304dde20de3721e Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Thu, 2 May 2019 21:42:08 +0200 Subject: RFC: soft/hardlookup: taint kernel There's the soft/hardlookup_panic sysctls, but that's a bit an extreme measure. As a fallback taint at least the machine. Our CI uses this to decide when a reboot is necessary, plus to figure out whether the kernel is still happy. References: https://gitlab.freedesktop.org/drm/intel/-/issues/8035 Signed-off-by: Daniel Vetter Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Valdis Kletnieks Cc: Laurence Oberman Cc: Vincent Whitchurch Cc: Don Zickus Cc: Andrew Morton Cc: Sergey Senozhatsky Cc: Sinan Kaya Cc: Daniel Vetter Acked-by: Chris Wilson (for core-for-CI) Link: https://patchwork.freedesktop.org/patch/msgid/20190502194208.3535-2-daniel.vetter@ffwll.ch Signed-off-by: Jani Nikula Signed-off-by: Rodrigo Vivi --- kernel/watchdog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 5cd6d4e26915..a721a21cc781 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -178,6 +178,8 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs) if (hardlockup_panic) nmi_panic(regs, "Hard LOCKUP"); + else + add_taint(TAINT_WARN, LOCKDEP_STILL_OK); per_cpu(watchdog_hardlockup_warned, cpu) = true; } else { @@ -532,6 +534,8 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer) add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK); if (softlockup_panic) panic("softlockup: hung tasks"); + else + add_taint(TAINT_WARN, LOCKDEP_STILL_OK); } return HRTIMER_RESTART; -- cgit v1.2.3