[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231209015211.357983-1-namhyung@kernel.org>
Date: Fri, 8 Dec 2023 17:52:11 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
Ravi Bangoria <ravi.bangoria@....com>,
Guilherme Amadio <amadio@...too.org>,
Stephane Eranian <eranian@...gle.com>
Subject: [PATCH] x86/nmi: Rate limit unknown NMI messages
On some AMD machines, unknown NMI messages were printed on the console
continuously when using perf command with IBS. It was reported that it
can slow down the kernel. Let's ratelimit the unknown NMI messages.
Cc: Ravi Bangoria <ravi.bangoria@....com>
Cc: Guilherme Amadio <amadio@...too.org>
Cc: Stephane Eranian <eranian@...gle.com>
Signed-off-by: Namhyung Kim <namhyung@...nel.org>
---
arch/x86/kernel/nmi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 17e955ab69fe..d23867901186 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -303,13 +303,13 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
__this_cpu_add(nmi_stats.unknown, 1);
- pr_emerg("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n",
- reason, smp_processor_id());
+ pr_emerg_ratelimited("Uhhuh. NMI received for unknown reason %02x on CPU %d.\n",
+ reason, smp_processor_id());
if (unknown_nmi_panic || panic_on_unrecovered_nmi)
nmi_panic(regs, "NMI: Not continuing");
- pr_emerg("Dazed and confused, but trying to continue\n");
+ pr_emerg_ratelimited("Dazed and confused, but trying to continue\n");
}
NOKPROBE_SYMBOL(unknown_nmi_error);
--
2.43.0.472.g3155946c3a-goog
Powered by blists - more mailing lists