Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1414475rdb; Mon, 2 Oct 2023 08:50:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGXHX962810+NnVY76Z6vcFTnqtZIgX1qcyVOShofPQf9v4iV1HKSMxcGMMaq/gfYI1+uDY X-Received: by 2002:a17:902:e851:b0:1c5:de65:f8a8 with SMTP id t17-20020a170902e85100b001c5de65f8a8mr11167742plg.1.1696261857230; Mon, 02 Oct 2023 08:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696261857; cv=none; d=google.com; s=arc-20160816; b=IOfmJgVnJHW2BQOeyWSZZVID8XPauBFYvGk4ZdjWvbDPrFkEUbwcvHzBDDBJscsb8y 3drpVFBmL8HfRPGZOzQUTPMY0di5f6+EheghwSpETyeU/TItqmAAODhU6t5xgnEJzsC8 2/CaYCZnAamg/zexxbYcfyj2/2gBCZ5bwQ1QM8C0emMy+IYpWYWV9YsQ0MrUYvqRnFa8 zV9mVFpqPzeE/NE71gIjBnES+Wf0u3slNbHUQ2Yvd+KUqx9xTM2gCmptpMpq3mBW9AmL 5i+bAOsq7nqPcd7/hOQXZPx7NowMZAnhsUmuLaNzsKMPgSKxQghhC9PH6FtcMyXVHkDr 8xzg== 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=5axOryBwnSRb4nxM/DdpfFMvDIVGxVikUXfV7UCZuE0=; fh=EpvHv8XlC1IZ6ZpYnSBulzLMIZPTkXN4Eihi3/Ww8Kc=; b=HpqYOo/9wzaewSc67OGRkDDqH1GhTufSB/iyULYQf+dsxNbGJ+uPIdr+1oOE2rZQ1/ L1ceL5uh+LN8FFind3KFYyb7z7nhOYBWIowls1kKrSeKQdm53sig8jaEzJ8qzIgAD7t9 /nYv9NzHHfC3NHnZDkeK33mwBAX53RKZO3eAFnRvxzMBi9kZ9a8PuMTxNV6JrW/N8EsW OulIEkjF7eBEZO2BNfiPTbm6+rEo4VDKYRkGpQzNpSwarCmPPsWFW4nAYGMUhmP1tOAr Ry+UNG9MjvsPnzxfwtCxxZi2lQ0xU0RYC3T7PyVg7hTQ44C/lC82DFUGf7bouElUScEC C1oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DIHu2sKI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a7-20020a170902ecc700b001c73489c6a5si11538840plh.484.2023.10.02.08.50.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 08:50:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DIHu2sKI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 03516801BA85; Mon, 2 Oct 2023 08:38:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238136AbjJBPiQ (ORCPT + 99 others); Mon, 2 Oct 2023 11:38:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237903AbjJBPiP (ORCPT ); Mon, 2 Oct 2023 11:38:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1C3793; Mon, 2 Oct 2023 08:38:12 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 391E1C433C7; Mon, 2 Oct 2023 15:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696261092; bh=zkVDhHmdG/HenpAh9KSbmzG6yizVpjgt+Q9FTI3CzxA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=DIHu2sKIpFWyW99niQioOPuOxRZTzm8CdaTpxDYdgbEHOz76PWGg76/9oK36p6w2+ ooKzkeyWiENKOcIxg/upZ0hc/2Dg2uXrPTv4/o+cbfICm6HlMI5qXTE5Rpqs3W907S fmYiJx4SSXuWII46frnnKLWlQzIT3bLFEZJb5iYJkHiD7Blnx5zbKzF+NvH9H6mgCc dAnJdKbN+JiaN1bSIzwjyz8OPM86YoJnJuaBy+2CARcJfYDzp1gqsP9Jy6JSF7JdAI q0ngD8myDXCKNTIn/KAZPuHGzu8b0g+esEOpdZwzmZzbN5SZFXkTSVbnt2LjpPdyo4 PZXrzwXWSvflQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id BF8D8CE0CCF; Mon, 2 Oct 2023 08:38:11 -0700 (PDT) Date: Mon, 2 Oct 2023 08:38:11 -0700 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: LKML , rcu , Uladzislau Rezki , Neeraj Upadhyay , Boqun Feng , Qiuxu Zhuo , Joel Fernandes Subject: Re: [PATCH 01/10] rcu: Use rcu_segcblist_segempty() instead of open coding it Message-ID: <9f42c0ad-80ab-442a-9d10-1b09597f2078@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20230908203603.5865-1-frederic@kernel.org> <20230908203603.5865-2-frederic@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230908203603.5865-2-frederic@kernel.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 08:38:18 -0700 (PDT) On Fri, Sep 08, 2023 at 10:35:54PM +0200, Frederic Weisbecker wrote: > This makes the code more readable. > > Reviewed-by: Qiuxu Zhuo > Reviewed-by: Joel Fernandes (Google) > Signed-off-by: Frederic Weisbecker Reviewed-by: Paul E. McKenney > --- > kernel/rcu/rcu_segcblist.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/rcu/rcu_segcblist.c b/kernel/rcu/rcu_segcblist.c > index f71fac422c8f..1693ea22ef1b 100644 > --- a/kernel/rcu/rcu_segcblist.c > +++ b/kernel/rcu/rcu_segcblist.c > @@ -368,7 +368,7 @@ bool rcu_segcblist_entrain(struct rcu_segcblist *rsclp, > smp_mb(); /* Ensure counts are updated before callback is entrained. */ > rhp->next = NULL; > for (i = RCU_NEXT_TAIL; i > RCU_DONE_TAIL; i--) > - if (rsclp->tails[i] != rsclp->tails[i - 1]) > + if (!rcu_segcblist_segempty(rsclp, i)) > break; > rcu_segcblist_inc_seglen(rsclp, i); > WRITE_ONCE(*rsclp->tails[i], rhp); > @@ -551,7 +551,7 @@ bool rcu_segcblist_accelerate(struct rcu_segcblist *rsclp, unsigned long seq) > * as their ->gp_seq[] grace-period completion sequence number. > */ > for (i = RCU_NEXT_READY_TAIL; i > RCU_DONE_TAIL; i--) > - if (rsclp->tails[i] != rsclp->tails[i - 1] && > + if (!rcu_segcblist_segempty(rsclp, i) && > ULONG_CMP_LT(rsclp->gp_seq[i], seq)) > break; > > -- > 2.41.0 >