Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5439704rwl; Tue, 11 Apr 2023 05:38:33 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5DRGo9LtKUXtYafR9OolsD75cJ3ZhXlhWOjGSJ0pvILI0Ir1Fc3IIKXyLOY9SQtUnxysh X-Received: by 2002:a17:907:388:b0:94a:9fae:749e with SMTP id ss8-20020a170907038800b0094a9fae749emr4772672ejb.12.1681216712906; Tue, 11 Apr 2023 05:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681216712; cv=none; d=google.com; s=arc-20160816; b=xHQbPjPXDbkDMifmktRAozY+j5Tov/7OWIAMvMnQbBkMd6BVhWzrbgR5SFMLjZbk2I eWA8UGreqkSDfMNjs+Ll830yMVO+aC4LGE+6FfyVVT0FA4imWPiQ/iya2y8ywXY9N/6G YVEZl8magPgAYzYXg8kZdYRUtuV5gmtyhhodJUSf4VlE7Vjd5ZnEmwphxoJv9DT+KDFY 8W2K8nZ0/UJSw5t8YIR9/HbzSkYyQ6aJIaKMINTm2N8uW/cX3RUSLfZfWMwFvaJ/To0g +qk2qc9kLEtdgbZUgrD3LqNwxghtkO+Ah7/Mih9d2gaWFHdFWRL4UE8CK1L03RmYtJYe RxAQ== 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:dkim-signature; bh=J2HCKRIBrXsU7kelLcEdA1HpSPdlc1PDVdwjnmLRAHI=; b=dSHq1AzlNqVjxksk/8rEH20NVp55a1ftgm7stil3zGX4JwBgFcksdhHgxaYfvqKoHN nlncJJJyNZ57buhGAqQdlEZ8m7cguBtRb8jxXa+lIXHpYbA82UYENpnesjuzk8O+ldta 3Ko2yHu5qiw6f3vL4zjM9IvgkCgAS/YrzdS69444gxv0bsPtsbEx3v3ErbH4NSpQwtWm qcJVzphQtwWQHJk6CkvMdqGfEuKzhE+HVbEe1Wq3QcLGllXlyQ8KeMILWTSaTO8oqHqd Y107af399DcNqur9GURXeXGI771varpzzucT56q2qQpirjNbqJRp48SMWuKwykPofBle N55w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=fXRtZnP0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 4-20020a170906300400b0094e152cc5cbsi1616491ejz.1016.2023.04.11.05.38.06; Tue, 11 Apr 2023 05:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=fXRtZnP0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229706AbjDKMcj (ORCPT + 99 others); Tue, 11 Apr 2023 08:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbjDKMci (ORCPT ); Tue, 11 Apr 2023 08:32:38 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE84D3C0D; Tue, 11 Apr 2023 05:32:36 -0700 (PDT) Received: from zn.tnic (p5de8e687.dip0.t-ipconnect.de [93.232.230.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 2864F1EC0102; Tue, 11 Apr 2023 14:32:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1681216355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=J2HCKRIBrXsU7kelLcEdA1HpSPdlc1PDVdwjnmLRAHI=; b=fXRtZnP0YqMKMv/C5tf9xXpS5Tm5Eg7tc9mSll/Wp16Zq5glKMdeNoXYxdpnG5xHPN+UWc 6KCbxd6LSxyOWXpATK4Zn78JqM+XtWFKpC+odxSZ/pru6PBIFFubLnsPPmidlshQ8cwDTu 89/cZGd8sZ7QukLK3ACd9MtFkPatUS0= Date: Tue, 11 Apr 2023 14:32:34 +0200 From: Borislav Petkov To: Tony Luck Cc: Yazen Ghannam , Smita.KoralahalliChannabasappa@amd.com, dave.hansen@linux.intel.com, x86@kernel.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v4 2/5] x86/mce: Add per-bank CMCI storm mitigation Message-ID: <20230411123234.GGZDVTYppLWRN5t0jX@fat_crate.local> References: <20230403210716.347773-1-tony.luck@intel.com> <20230403210716.347773-3-tony.luck@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230403210716.347773-3-tony.luck@intel.com> X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 03, 2023 at 02:07:13PM -0700, Tony Luck wrote: > Add a hook into machine_check_poll() to keep track of per-CPU, per-bank > corrected error logs. > > Maintain a bitmap history for each bank showing whether the bank > logged an corrected error or not each time it is polled. > > In normal operation the interval between polls of this banks > determines how far to shift the history. The 64 bit width corresponds > to about one second. > > When a storm is observed the Rate of interrupts is reduced by setting > a large threshold value for this bank in IA32_MCi_CTL2. This bank is > added to the bitmap of banks for this CPU to poll. The polling rate > is increased to once per second. > During a storm each bit in the history indicates the status of the > bank each time it is polled. Thus the history covers just over a minute. > > Declare a storm for that bank if the number of corrected interrupts > seen in that history is above some threshold (5 in this RFC code for > ease of testing, likely move to 15 for compatibility with previous > storm detection). > > A storm on a bank ends if enough consecutive polls of the bank show > no corrected errors (currently 30, may also change). That resets the > threshold in IA32_MCi_CTL2 back to 1, removes the bank from the bitmap > for polling, and changes the polling rate back to the default. > > If a CPU with banks in storm mode is taken offline, the new CPU > that inherits ownership of those banks takes over management of > storm(s) in the inherited bank(s). > > Signed-off-by: Tony Luck > Reviewed-by: Yazen Ghannam > Tested-by: Yazen Ghannam > --- > arch/x86/kernel/cpu/mce/internal.h | 4 +- > arch/x86/kernel/cpu/mce/core.c | 26 ++++-- > arch/x86/kernel/cpu/mce/intel.c | 139 ++++++++++++++++++++++++++++- > 3 files changed, 158 insertions(+), 11 deletions(-) ld: vmlinux.o: in function `machine_check_poll': /home/boris/kernel/2nd/linux/arch/x86/kernel/cpu/mce/core.c:683: undefined reference to `track_cmci_storm' make[1]: *** [scripts/Makefile.vmlinux:35: vmlinux] Error 1 make: *** [Makefile:1249: vmlinux] Error 2 make: *** Waiting for unfinished jobs.... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette