Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1019828iob; Fri, 13 May 2022 19:53:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxw6XB4+JJekAse3rXfNyDPrmxLQJAYg5xofQD+UStYpeF+5PZ2Gpy+jOH7AI2A+94S6ZBe X-Received: by 2002:a05:600c:4ed1:b0:394:8352:3ea1 with SMTP id g17-20020a05600c4ed100b0039483523ea1mr6844496wmq.153.1652496808363; Fri, 13 May 2022 19:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652496808; cv=none; d=google.com; s=arc-20160816; b=Vhiq7qH+0NCSov0MGVFf7BnYl+LffYlVv7R0aDBfeBCN2Da574SGmGUlBuIM8/5GKd SGIRGK6GKawMDHMWOvWsam4J4hfxbrbBpmNVsVyDraUatkMQCbCGNbL7V7nrL7g/8J8Z Fg8Tf4jBlq6hvP3L8I3/yl02XuvGUjzo9vILJdeU63qS+QAXUbjDLdqGBWYnP8Um709F 0DNjkn/q9jpmTjR6kWcTzoHzs6kVTlJsFoWX4NGX3BqaRzPWnNIBzjJ/auMx4kVCjS3+ +DdaWwZ/AMJ2XCFReWwYAdTpkXV2TLCNYTH2v39XQQKsiVdOmkqEXWVsjCcf6Zj5ckn1 eSXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=JkCVDITxlYSMZ9dmU2/XSNh/HXJm6JTYEVBpu8Kwxe4=; b=w23jj+Nh+qi7dWwHmdfHMKY9cDHivbKnXu3LkElPAri9sk/59XmsFBYw7L9MGM3B5a /1zkiqlI8isbuckt9bMMK9MC+Mbw0sI1VvPMsg0Ydgt1bczGFoiBRT1WMLu2FDMgnv0n y3MkUPKIZZmqFYhAhF11Ljjbm7S3OSR0LNCq2keo53jpNkjLpqrbKMTuNI7TbXWTdteV DVVfKVlCGxLJTIwAXESli6jGzOyh/SIV9H+cGDsd/Qf7XxbM1Pv6kBpztrqvGQTd5OfR hg+cGoJrZP01iZ5j8uZVhpOv12CldV5dEZiUlywPAWbRGSq833c2j7H7XomiBO5mbplM JEJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q04s0Y9V; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e5-20020a05600c254500b003947ec62c64si6547951wma.221.2022.05.13.19.53.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:53:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q04s0Y9V; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 005D8381D61; Fri, 13 May 2022 16:39:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbiEMWNT (ORCPT + 99 others); Fri, 13 May 2022 18:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbiEMWNS (ORCPT ); Fri, 13 May 2022 18:13:18 -0400 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79E2B719DB for ; Fri, 13 May 2022 15:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652479996; x=1684015996; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=cxef9S28Y+ZsR9yxpw47GL3tVgcHUSJqzLfqt+5PNSo=; b=Q04s0Y9VtUDQRM4mG92f3MMBXfQDBkqGdEsZ5j/+TPA+YetCe2HoTezj dpwcplWrID1tY897TIoEynRXM9J1r3FoLjtucFULc7YdfcXlwpqIYZI9O TUnta5b22dKHX/BYW2M8+u+l+bcr85RvGTtFSaJC60iXsSFrzbybWY9L9 dWuqvpPN5PeRb+UfK3WwWYLgS1XxEmzxVji8oNtyCU4JWtSBS3lzBO6UM 47ukV5tF9WKnxqga4DyNC4gT8zXhjnhutRev+KtpIPh1X6DmpCMWpXNnG PVk2eDh/Rl9ke6LPIOY/vSeEXYvdiLXuh5SRaUV4ra6S3tQ3Jnj4CUlhJ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10346"; a="270357920" X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="270357920" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2022 15:13:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,223,1647327600"; d="scan'208";a="543454884" Received: from ranerica-svr.sc.intel.com ([172.25.110.23]) by orsmga006.jf.intel.com with ESMTP; 13 May 2022 15:13:15 -0700 Date: Fri, 13 May 2022 15:16:50 -0700 From: Ricardo Neri To: Thomas Gleixner Cc: x86@kernel.org, Tony Luck , Andi Kleen , Stephane Eranian , Andrew Morton , Joerg Roedel , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Nicholas Piggin , "Ravi V. Shankar" , Ricardo Neri , iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 22/29] x86/watchdog/hardlockup: Add an HPET-based hardlockup detector Message-ID: <20220513221650.GA8691@ranerica-svr.sc.intel.com> References: <20220506000008.30892-1-ricardo.neri-calderon@linux.intel.com> <20220506000008.30892-23-ricardo.neri-calderon@linux.intel.com> <877d6uref8.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <877d6uref8.ffs@tglx> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 09, 2022 at 04:03:39PM +0200, Thomas Gleixner wrote: > On Thu, May 05 2022 at 17:00, Ricardo Neri wrote: > > + if (is_hpet_hld_interrupt(hdata)) { > > + /* > > + * Kick the timer first. If the HPET channel is periodic, it > > + * helps to reduce the delta between the expected TSC value and > > + * its actual value the next time the HPET channel fires. > > + */ > > + kick_timer(hdata, !(hdata->has_periodic)); > > + > > + if (cpumask_weight(hld_data->monitored_cpumask) > 1) { > > + /* > > + * Since we cannot know the source of an NMI, the best > > + * we can do is to use a flag to indicate to all online > > + * CPUs that they will get an NMI and that the source of > > + * that NMI is the hardlockup detector. Offline CPUs > > + * also receive the NMI but they ignore it. > > + * > > + * Even though we are in NMI context, we have concluded > > + * that the NMI came from the HPET channel assigned to > > + * the detector, an event that is infrequent and only > > + * occurs in the handling CPU. There should not be races > > + * with other NMIs. > > + */ > > + cpumask_copy(hld_data->inspect_cpumask, > > + cpu_online_mask); > > + > > + /* If we are here, IPI shorthands are enabled. */ > > + apic->send_IPI_allbutself(NMI_VECTOR); > > So if the monitored cpumask is a subset of online CPUs, which is the > case when isolation features are enabled, then you still send NMIs to > those isolated CPUs. I'm sure the isolation folks will be enthused. Yes, I acknowledged this limitation in the cover letter. I should also update Documentation/admin-guide/lockup-watchdogs.rst. This patchset proposes the HPET NMI watchdog as an opt-in feature. Perhaps the limitation might be mitigated by adding a check for non-housekeeping and non-monitored CPUs in exc_nmi(). However, that will not eliminate the problem of isolated CPUs also getting the NMI. Thanks and BR, Ricardo