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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BC36C433DB for ; Wed, 6 Jan 2021 18:33:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD84122B4B for ; Wed, 6 Jan 2021 18:33:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726687AbhAFSd3 (ORCPT ); Wed, 6 Jan 2021 13:33:29 -0500 Received: from mail.skyhub.de ([5.9.137.197]:59494 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbhAFSd2 (ORCPT ); Wed, 6 Jan 2021 13:33:28 -0500 Received: from zn.tnic (p200300ec2f096900fa39b7692df2441c.dip0.t-ipconnect.de [IPv6:2003:ec:2f09:6900:fa39:b769:2df2:441c]) (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 5550D1EC04EF; Wed, 6 Jan 2021 19:32:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1609957967; 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=ivwHOniwz5qGdYhs1Yn9GcbjBz+NdsKmDIMr40UYDcg=; b=CmfSIcfachhNklFKKiI/2js7DmC7mtHOkJmvcz4G2Rh3SDKEP2ATVd1AiipTBgnXc8Lism 8kAry/NOoOFwEqrwNnE+YPN6lRqfTl1hxZG6DGP+UfX8HwxvUElb47/B6zzzTbm3bQN9WG rXlutzz821hNpT14cZ1WMHJO1MtIRPw= Date: Wed, 6 Jan 2021 19:32:44 +0100 From: Borislav Petkov To: "Paul E. McKenney" Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-edac@vger.kernel.org, tony.luck@intel.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, kernel-team@fb.com Subject: Re: [PATCH RFC x86/mce] Make mce_timed_out() identify holdout CPUs Message-ID: <20210106183244.GA24607@zn.tnic> References: <20210106174102.GA23874@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210106174102.GA23874@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 06, 2021 at 09:41:02AM -0800, Paul E. McKenney wrote: > The "Timeout: Not all CPUs entered broadcast exception handler" message > will appear from time to time given enough systems, but this message does > not identify which CPUs failed to enter the broadcast exception handler. > This information would be valuable if available, for example, in order to > correlated with other hardware-oriented error messages. Because you're expecting that the CPUs which have not entered the exception handler might have stuck earlier and that's the correlation there? > This commit That's a tautology. :) > therefore maintains a cpumask_t of CPUs that have entered this handler, > and prints out which ones failed to enter in the event of a timeout. > Build-tested only. > > Cc: Tony Luck > Cc: Borislav Petkov > Cc: Thomas Gleixner > Cc: Ingo Molnar > Cc: "H. Peter Anvin" > Cc: > Cc: > Reported-by: Jonathan Lemon > Signed-off-by: Paul E. McKenney > > diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c > index 13d3f1c..44d2b99 100644 > --- a/arch/x86/kernel/cpu/mce/core.c > +++ b/arch/x86/kernel/cpu/mce/core.c > @@ -878,6 +878,12 @@ static atomic_t mce_executing; > static atomic_t mce_callin; > > /* > + * Track which CPUs entered and not in order to print holdouts. > + */ > +static cpumask_t mce_present_cpus; > +static cpumask_t mce_missing_cpus; > + > +/* > * Check if a timeout waiting for other CPUs happened. > */ > static int mce_timed_out(u64 *t, const char *msg) > @@ -894,8 +900,12 @@ static int mce_timed_out(u64 *t, const char *msg) > if (!mca_cfg.monarch_timeout) > goto out; > if ((s64)*t < SPINUNIT) { > - if (mca_cfg.tolerant <= 1) > + if (mca_cfg.tolerant <= 1) { > + if (!cpumask_andnot(&mce_missing_cpus, cpu_online_mask, &mce_present_cpus)) > + pr_info("%s: MCE holdout CPUs: %*pbl\n", > + __func__, cpumask_pr_args(&mce_missing_cpus)); > mce_panic(msg, NULL, NULL); > + } > cpu_missing = 1; > return 1; > } > @@ -1006,6 +1016,7 @@ static int mce_start(int *no_way_out) > * is updated before mce_callin. > */ > order = atomic_inc_return(&mce_callin); Doesn't a single mce_callin_mask suffice? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette