From: Guilherme Amadio <amadio@gentoo.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
x86@kernel.org, Ravi Bangoria <ravi.bangoria@amd.com>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] x86/nmi: Rate limit unknown NMI messages
Date: Sun, 10 Dec 2023 11:39:05 +0100 [thread overview]
Message-ID: <ZXWVSXqAkOGRs3UG@gentoo.org> (raw)
In-Reply-To: <20231209015211.357983-1-namhyung@kernel.org>
On Fri, Dec 08, 2023 at 05:52:11PM -0800, Namhyung Kim wrote:
> 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@amd.com>
> Cc: Guilherme Amadio <amadio@gentoo.org>
The rate of messages on the console were proportional to the sampling frequency
when I noticed this happening, so this is a welcome change. Thank you!
Acked-by: Guilherme Amadio <amadio@gentoo.org>
Best regards,
-Guilherme
> Cc: Stephane Eranian <eranian@google.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.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
>
next prev parent reply other threads:[~2023-12-10 10:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-09 1:52 [PATCH] x86/nmi: Rate limit unknown NMI messages Namhyung Kim
2023-12-10 10:39 ` Guilherme Amadio [this message]
2023-12-12 4:16 ` Ravi Bangoria
2024-01-25 16:35 ` [tip: x86/misc] " tip-bot2 for Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZXWVSXqAkOGRs3UG@gentoo.org \
--to=amadio@gentoo.org \
--cc=acme@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.