Re: [PATCH] lib/nmi_backtrace: print out the CPUs which fail to respond to NMI

From: Feng Tang

Date: Fri May 22 2026 - 01:02:57 EST


On Thu, May 21, 2026 at 08:53:26PM -0700, Andrew Morton wrote:
>
> Looks great. But you missed the fun part!
>
> --- a/lib/nmi_backtrace.c~lib-nmi_backtrace-print-out-the-cpus-which-fail-to-respond-to-nmi-fix-fix
> +++ a/lib/nmi_backtrace.c
> @@ -16,6 +16,7 @@
> #include <linux/cpumask.h>
> #include <linux/delay.h>
> #include <linux/kprobes.h>
> +#include <linux/stringify.h>
> #include <linux/nmi.h>
> #include <linux/cpu.h>
> #include <linux/sched/debug.h>
> @@ -79,8 +80,8 @@ void nmi_trigger_cpumask_backtrace(const
> }
>
> if (!cpumask_empty(to_cpumask(backtrace_mask))) {
> - pr_warn("After %d seconds, these CPUS still haven't responded to the NMI: %*pbl\n",
> - NMI_BT_TIMEOUT_SEC, cpumask_pr_args(to_cpumask(backtrace_mask)));
> + pr_warn("After " __stringify(NMI_BT_TIMEOUT_SEC) " seconds, these CPUS still haven't responded to the NMI: %*pbl\n",
> + cpumask_pr_args(to_cpumask(backtrace_mask)));
>
> nmi_backtrace_stall_check(to_cpumask(backtrace_mask));
> }
> _
>
> It saved five bytes!

Good to know :) Thanks for the trick!