Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1396072iog; Sat, 18 Jun 2022 08:17:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vCbK7ljh6Tdu2I/CgbYW6mjinP2P/cNC83FUbLZlofO3LSB5voHTKZ8peB12VM2E5Ev0ub X-Received: by 2002:a17:906:4ad1:b0:718:c7cb:1cf1 with SMTP id u17-20020a1709064ad100b00718c7cb1cf1mr13999245ejt.519.1655565437506; Sat, 18 Jun 2022 08:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655565437; cv=none; d=google.com; s=arc-20160816; b=loetl2os7DtK4LrtEgoxAX7LIxwMWmSTV5FaBkBrDKX+U9jcJulDxHovCGKsOaZCTQ 27y+jIk+PsSrJtc5uMeX+uBPXwrGQoUBX7EVaoOnaU28uKa4oi+Q8DPSrHcdS8ePQt3N IiYIUVmVffGEviTfe1DzzcXi5Gpn8C6ayLbIVwoM/Lf3Rq9+/DLQg5PGRs3ugVzlNDft LbQz1nQ94FJbKgAMwvirjUBd0G4YKw8Kf9Y1ZRvU88WXWtNh2oodv33n9OHrzLKxSBkC UhnVwqnQ839qvac4ejpFDt+d6AVEdmdWZ6Jx6jVbapkowMXZcVSFnhpKdbg6/bYKD83M ALGA== 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-transfer-encoding :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=T5Sw9LTXdbTqZ8f0V8LqVg4bDVqUuFdjoz+92WvXpVU=; b=gM+64eF0hT6i4edxn5NF7OlN1QGBY7idp0HBk27PQTk+Xb3ZgcZkATtQIBrmktgJLH XkOkuBoqQexGAgTy2oe6gw4oz92pLi7ZQVqnCO5rJgZlaHRpof8hckcuViVDW+ebRuie lV0d74/4s9MDluumv1HUF4rytJPSx+tqIGP7oE35r+5mLASmvyz3ZtFseQSAIqJETO0d L6GA95hbCKpw/FYbllv9LB9L1F3zhFDWjatVXZR+9+2orTnPO6MG8Et4RyWa5Lw2uET2 8pOtd0T3brr4eIV7jVXXS2t4KdGxhrcgMytKvDUofskU9Xr8Tj6W32cBaP7vXqnE0PkM u1oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gRQ0zsfk; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a056402074c00b004356a7de065si2690792edy.287.2022.06.18.08.16.20; Sat, 18 Jun 2022 08:17:17 -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=@kernel.org header.s=k20201202 header.b=gRQ0zsfk; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233973AbiFRO5D (ORCPT + 99 others); Sat, 18 Jun 2022 10:57:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230133AbiFRO5B (ORCPT ); Sat, 18 Jun 2022 10:57:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCB8C1A06A; Sat, 18 Jun 2022 07:57:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4BB76608D4; Sat, 18 Jun 2022 14:57:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 987BFC3411A; Sat, 18 Jun 2022 14:56:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655564219; bh=NMcZ+TIlHzsocox4f4AZvLmGtBRqPwvJ9m5NXVjAR0s=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=gRQ0zsfkthzj94J+z8Lb+rmVHFs6nifCsJhsPsvsHk6wNNcku+5RS5y0NAuFMvDf+ fDFXUvLgkMyBuWunhndbM+3Pe/LBV0cW8zDlDDR/HupXU2z8dhzQa7joUyRZWhSVMl 0B84j2BWXPrVUw8IRla5NvA6CVd/+B5mgu/wRyKsNG4pGoXeIGD+dBY5FSLFZnTm0B oW8RlGVJWnAioFtDs1cwyaPuyBB0GJR2a0EZ2IYBrYwGg5ONNn5+tVWnkUIkMim9lZ pKiWjC7ivMKJBL64hQCqARltde+q/Et4MGmg77QHsiFeWdhyPzvKC6wghfKeDJrGxF 1/9YV8/87ofYg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 3E0275C03A7; Sat, 18 Jun 2022 07:56:59 -0700 (PDT) Date: Sat, 18 Jun 2022 07:56:59 -0700 From: "Paul E. McKenney" To: "Zhang, Qiang1" Cc: Frederic Weisbecker , "rcu@vger.kernel.org" , LKML Subject: Re: [PATCH] rcu: Avoid strict QS reporting in NMI context Message-ID: <20220618145659.GM1790663@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20220618022255.1697816-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Sat, Jun 18, 2022 at 12:15:23PM +0000, Zhang, Qiang1 wrote: > Le sam. 18 juin 2022, 04:23, Zqiang > a écrit : > Avoid invoke rcu_report_qs_rdp() in NMI handlers, in NMI handlers, > acquiring raw_spinlocks should be avoided, prevent NMI handlers > from blocking(spin) unnecessarily. > > This commit make rcu_read_unlock_strict() early return when in > NMI context. > > Signed-off-by: Zqiang > > --- > kernel/rcu/tree_plugin.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h > index dc78726b993f..e7a36e248a8a 100644 > --- a/kernel/rcu/tree_plugin.h > +++ b/kernel/rcu/tree_plugin.h > @@ -821,7 +821,7 @@ void rcu_read_unlock_strict(void) > { > struct rcu_data *rdp; > > - if (irqs_disabled() || preempt_count() || !rcu_state.gp_kthread) > + if (in_nmi() || irqs_disabled() || preempt_count() || !rcu_state.gp_kthread) > > >Doesn't preempt_count() imply in_nmi()? > > > > > > It looks like this, thanks Frederic > > #define nmi_count() (preempt_count() & NMI_MASK) > #define in_nmi() (nmi_count()) > > Hi Paul, sorry it’s my mistake. Thank you both for catching this! I clearly should not be reviewing incoming patches late on Friday evening! Thanx, Paul > >Thanks. > > return; > rdp = this_cpu_ptr(&rcu_data); > rdp->cpu_no_qs.b.norm = false; > -- > 2.25.1