[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230805160144.121875-1-liusong@linux.alibaba.com>
Date: Sun, 6 Aug 2023 00:01:44 +0800
From: Liu Song <liusong@...ux.alibaba.com>
To: akpm@...ux-foundation.org, dianders@...omium.org, pmladek@...e.com
Cc: liusong@...ux.alibaba.com, linux-kernel@...r.kernel.org
Subject: [PATCH] watchdog/hardlockup: set watchdog_hardlockup_warned to true as early as possible
Since we want to ensure only printing hardlockups once, it is necessary
to set "watchdog_hardlockup_warned" to true as early as possible.
Signed-off-by: Liu Song <liusong@...ux.alibaba.com>
---
kernel/watchdog.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 25d5627a6580..c4795f2d148c 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -180,6 +180,8 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
/* Only print hardlockups once. */
if (per_cpu(watchdog_hardlockup_warned, cpu))
return;
+ else
+ per_cpu(watchdog_hardlockup_warned, cpu) = true;
pr_emerg("Watchdog detected hard LOCKUP on cpu %d\n", cpu);
print_modules();
@@ -206,8 +208,6 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
if (hardlockup_panic)
nmi_panic(regs, "Hard LOCKUP");
-
- per_cpu(watchdog_hardlockup_warned, cpu) = true;
} else {
per_cpu(watchdog_hardlockup_warned, cpu) = false;
}
--
2.19.1.6.gb485710b
Powered by blists - more mailing lists