[PATCH] watchdog: output this_cpu when printing hard LOCKUP

Yunhui Cui posted 1 patch 1 year ago
kernel/watchdog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] watchdog: output this_cpu when printing hard LOCKUP
Posted by Yunhui Cui 1 year ago
When printing "Watchdog detected hard LOCKUP on cpu", also output
the detecting CPU. It's more intuitive.

Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
---
 kernel/watchdog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 262691ba62b7a..718e8c6fbe277 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -190,7 +190,7 @@ void watchdog_hardlockup_check(unsigned int cpu, struct pt_regs *regs)
 		 * with printk_cpu_sync_get_irqsave() that we can still at least
 		 * get the message about the lockup out.
 		 */
-		pr_emerg("Watchdog detected hard LOCKUP on cpu %d\n", cpu);
+		pr_emerg("CPU%u: Watchdog detected hard LOCKUP on cpu %u\n", this_cpu, cpu);
 		printk_cpu_sync_get_irqsave(flags);
 
 		print_modules();
-- 
2.39.2
Re: [PATCH] watchdog: output this_cpu when printing hard LOCKUP
Posted by Doug Anderson 1 year ago
Hi,

On Tue, Dec 10, 2024 at 1:52 AM Yunhui Cui <cuiyunhui@bytedance.com> wrote:
>
> When printing "Watchdog detected hard LOCKUP on cpu", also output
> the detecting CPU. It's more intuitive.
>
> Signed-off-by: Yunhui Cui <cuiyunhui@bytedance.com>
> ---
>  kernel/watchdog.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Seems reasonable to me.

Reviewed-by: Douglas Anderson <dianders@chromium.org>