Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3362488rdb; Sun, 10 Dec 2023 02:39:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcqdNOnqW9ivAQ3tYfduBGwcOPDvnV1Fy/7U5g4+JDS21Wz77XdhQH9gXfWCwYEqX0Y3Wo X-Received: by 2002:a05:6e02:158b:b0:35d:6759:93f3 with SMTP id m11-20020a056e02158b00b0035d675993f3mr4402768ilu.52.1702204765361; Sun, 10 Dec 2023 02:39:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702204765; cv=none; d=google.com; s=arc-20160816; b=YSadEE23aCWBcJoh7m1zUCF2D+KeEuFd1NRNvJxlwP17ukvByiVJmnfAHJ0S8iM71D 9zJ53mTpLag/SdxH+INpBLo72/o+MbZTvINj7PEVG3ccAklU8tqh5XVX3H8aWF8wz37c jJ0scF7pk6joa8RE1FEfonInQum6SX1fzBFIk5HptP0G9IRWWod5R1FoNHej5KiKafKL yfSJgNcfyTso8XGDu9DElg0iK1anBpPB49DXgJx+oXNi9WUOzKFYy1OTZiC+1MoPmDeM wqSlxguY6upHMFZPCq7jUaawEcsASe37ekf+so+C8hIg7m/5KTWU+8hCQra8hLawV4oo wLoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Yh911lpByBgSmmELZp60POPMPHug6R2hcYCf9Q1z284=; fh=Thom1UebpR9qd0EM3I8yF8Sr7hdxgnfy0n8LGSp9iS4=; b=K4DSsWLK4GvVRa08fQilDcmiJjQYt0uo8RbiQBOyewbgYQ8KKrxB4mh3YY3vAGK4Ad g44EiGoZ/W6wBSusEuX/FTlrQ4dUpZM2Dp8CieaCeQt6LPzoJhbkLPQTIWulhFsWWB5i ivklglHo3wh1vHCO/gat6LVXD19PviBbNlNMWx9BTYwhWyIC9Yrd2TbYtk4BpldHnfUO A5r2PeYKlQT0w5b6zwxFPBkleSuN4ZY+ZPH58XL8KfojewkoWvTfZAc1t2WK/OcuGG4f iwxd+5rUTZvDevZ665cy48ld5lIS/4KjPd3EneliGxIUi140VoQ4AlrX/mksM4fO03Q/ UX8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id v10-20020a1709029a0a00b001cfdd31f20esi4325460plp.267.2023.12.10.02.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 02:39:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id D917C808EDED; Sun, 10 Dec 2023 02:39:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229596AbjLJKjF (ORCPT + 99 others); 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> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 10 Dec 2023 02:39:23 -0800 (PST) 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 >