From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61E5FC4167B for ; Sun, 10 Dec 2023 10:39:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231753AbjLJKjF (ORCPT ); Sun, 10 Dec 2023 05:39:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjLJKjE (ORCPT ); Sun, 10 Dec 2023 05:39:04 -0500 Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24BBE99 for ; Sun, 10 Dec 2023 02:39:10 -0800 (PST) Date: Sun, 10 Dec 2023 11:39:05 +0100 From: Guilherme Amadio To: Namhyung Kim Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Borislav Petkov , Dave Hansen , Peter Zijlstra , Arnaldo Carvalho de Melo , LKML , x86@kernel.org, Ravi Bangoria , Stephane Eranian Subject: Re: [PATCH] x86/nmi: Rate limit unknown NMI messages Message-ID: References: <20231209015211.357983-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231209015211.357983-1-namhyung@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 > Cc: Guilherme Amadio 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 Best regards, -Guilherme > Cc: Stephane Eranian > Signed-off-by: Namhyung Kim > --- > 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 >