Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp460824rwo; Fri, 21 Jul 2023 15:03:15 -0700 (PDT) X-Google-Smtp-Source: APBJJlE2zL7CqTZL6uQRxFmgOtNRLzPi2HCWMLbNbXy1krrqPj1IyiBokd5qHPBdRv0g+0Pxq9M3 X-Received: by 2002:a05:6a20:12c6:b0:133:3682:3cdf with SMTP id v6-20020a056a2012c600b0013336823cdfmr2952136pzg.11.1689976994777; Fri, 21 Jul 2023 15:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689976994; cv=none; d=google.com; s=arc-20160816; b=HCpwlstf9plblzVYyKWshesBeRdZTI+NP8TgnIJeD+24ahxTPHP1v8ysA4tU3kzxfu fwh7Op0tOAlMmMiSBYBe/3dQiI8sUYhJq+WgbpnG52Smhlj/LuulyS0hn5FDlJMXgBee 6HN5WNKR+RsyauXZlmaL4E9O1AJ+stjjTkv2+gVM3ucq9htjawMx9wWeZucjRyTLMWF+ 0TBQAEbT3KddeA+YJLP2p6ocQK6Qtm8GJClRi8jGBfyNhPEYFjydywI4Wi4mTsQ8zih/ 0YkkQZ3dSDq3RBnmxbstDpxtxBzYSNNVW8PWUVIs+3QK39ZppC2osBK3uo1uWYzsb98h KPjw== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=VtgYOZest/a2t9AoQiyAWC8zIV+60mymOlO9lMVnweA=; fh=1QFaOei02aX2T8UxCE38mCi1wrvJroJxFdR7vsiDM0c=; b=ctdxR8ao4CVFG334Zl1KTP9jgmhi9a0ZKiutuk4oiFtwG36fxbcmKw6s5CUoP9VL2a OzTfZZHZRdRZXfGyWfkXVm5C1MBTzEJb2J9jit1N8fTrQW905rr7yiCjakW52s0ZGxQy rcdNdl8LNMKdroIgb2jI5UitfIeoeuivb+UHX+SupHluwWPbjEDx2NDMFPPiqh7dcbdJ l0NHtGvhMuIBbaUs02o8KPnrrty3Le4zkcB8Q7piuTlv+PpmCELFaI3spsyk+d0zKbbj vAView8BMoAOz6CCINRX/S7ET0Cx2WURflRsyEIOhxYMf3DfUtZ+BE3uGKmKURnzmksX 1VEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M5aI52Em; 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 y1-20020a056a00190100b006728f1913cfsi3696416pfi.336.2023.07.21.15.03.02; Fri, 21 Jul 2023 15:03:14 -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=M5aI52Em; 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 S229846AbjGUVnv (ORCPT + 99 others); Fri, 21 Jul 2023 17:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbjGUVnt (ORCPT ); Fri, 21 Jul 2023 17:43:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13F703A86; Fri, 21 Jul 2023 14:43:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A61B861D9E; Fri, 21 Jul 2023 21:43:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08A65C433C7; Fri, 21 Jul 2023 21:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689975828; bh=5OypTY92vR4ii5FD5NdPd22+sYnRdWN6NGC5ng0U2No=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=M5aI52EmmH2dyMkJeZpuhvn8b99Z/c8eBlHhZ5LvSz78tdVK0EZ71qcGTjKnzn3Aq q1fyq+kMuzFhs6RFP3XxjLKR8hq74R8mErvhlLqTFb75jlzSlqezJfSMKPbtupxJd/ bQG1QhoCrxYdkiinZ/DcCnhRtHtIRWsvsn8rZQnYD2xTRzWTZRZkXd88gKHrOjMSCF YjClnzwVtOnutwjPKVegC/DsEMjiN0jFxQ/c1PS5CMTWkm8nILsVNUasLhxLeCqQiG J9uXtOmqgSDiYd1su4l+aJYiI15JssKHAmMfHBttVlcgzvN9ZevOMN9JE+I7qY6HG1 9jtQZoTyvuZNg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 8C580CE09E0; Fri, 21 Jul 2023 14:43:47 -0700 (PDT) Date: Fri, 21 Jul 2023 14:43:47 -0700 From: "Paul E. McKenney" To: Levi Yun Cc: frederic@kernel.org, quic_neeraju@quicinc.com, joel@joelfernandes.org, osh@joshtriplett.org, boqun.feng@gmail.com, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, qiang.zhang1211@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: remove unnecessary check cpu_no_qs.norm on rcu_report_qs_rdp Message-ID: <05e98227-77f4-4918-8f8e-2170a158e350@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20230721121534.44328-1-ppbuk5246@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230721121534.44328-1-ppbuk5246@gmail.com> X-Spam-Status: No, score=-7.1 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 Fri, Jul 21, 2023 at 01:15:33PM +0100, Levi Yun wrote: > Wherever rcu_report_qs_rdp is called, cpu_no_qs.norm value is false. > Therefore, Remove unnecessary check in rcu_report_qs_rdp. > > Signed-off-by: Levi Yun Why not start with something like this? if (!WARN_ON_ONCE(!rdp->cpu_no_qs.b.norm) || rdp->gp_seq != rnp->gp_seq || rdp->gpwrap) { Except that rcu_report_qs_rdp() is invoked with interrupts enabled, which means that there is some possibility of state changes up to the raw_spin_lock_irqsave_rcu_node(rnp, flags) statement. So, did you check whether RCU's interrupt paths change this state? Thanx, Paul > --- > kernel/rcu/tree.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 1449cb69a0e0..d840596e9903 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -1962,8 +1962,7 @@ rcu_report_qs_rdp(struct rcu_data *rdp) > WARN_ON_ONCE(rdp->cpu != smp_processor_id()); > rnp = rdp->mynode; > raw_spin_lock_irqsave_rcu_node(rnp, flags); > - if (rdp->cpu_no_qs.b.norm || rdp->gp_seq != rnp->gp_seq || > - rdp->gpwrap) { > + if (rdp->gp_seq != rnp->gp_seq || rdp->gpwrap) { > > /* > * The grace period in which this quiescent state was > -- > 2.37.2