Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp272410rwl; Thu, 30 Mar 2023 15:57:31 -0700 (PDT) X-Google-Smtp-Source: AKy350aT214eBtU40IXiMdH8X6OvnUdERQoK3tzUEsfLlSRiKm39+nWoyBUG58cHHHYbLZWLLsHq X-Received: by 2002:a17:902:f693:b0:19a:a815:2877 with SMTP id l19-20020a170902f69300b0019aa8152877mr3893278plg.6.1680217050970; Thu, 30 Mar 2023 15:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680217050; cv=none; d=google.com; s=arc-20160816; b=TC2ceedBOUs5uKSxjUXo8oHVbAgBUJyDFu+IddyuIxd4cFo2molrPkS4bjGsi8hVZQ jwkGixqqfuDvkEMB8AXJ8Zq2St5mSpg3kjS9EmbZLxOLo2Ne6TqTxAG0RkVl7sUntZMX LG7zhrqqc6DoHxbz7JThHvDWJ+j2DIJjYwmFTxHnUwkuum7amoX8jcFeKulSFhyYD8C3 FDub+AfH2QSqom19m0zwDhGwKUp8tet1NVZDvX9HU/UH8QxAZTr1XoG3XYi+STFJOQGy gD/kkwaJPYuIVUJiAhOTKe1mE3D+skrguEPTm0yKsVwJ/pdFg4ntSX6NOQGlDZChq7Mw /xJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S6E8+wgy6c+2zdn9r2h1L8Wf7k1ITNCeeqE6/eYCxf8=; b=FgwH4mzE21lXs1ESvBPZhp8qKiVZegSBjM0X53twRkNQDQKolnE14AuAIkFbqG+MUO 5JnOplZk4PiwvvDdWCX76ZP1Li5Dmfkjep7D0LjHM5x/ZEsNvPkDJC4GSPGwY9wXM10U QYcHI56fnqn3yhiV32MKlbi+ejHj6BFhjKpSDzh03DwtGOhMRiefnjOt0oejn8cUFtkk yR/mysfScujuf7FSQGM18FfILqVei/ommqf3RjlDmCqkDofoof2IHX/Z1h+pUatlQ5ni 95XoGJN0Uubgm8CPnK+jqYCiR5xOlumOJy2JBInYaUJAegwUSf0apJKmPwU15xa7fHBq 5Ttg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kGpLiTL7; 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 w16-20020a63c110000000b0050c04831b5fsi819950pgf.286.2023.03.30.15.57.18; Thu, 30 Mar 2023 15:57:30 -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=kGpLiTL7; 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 S231311AbjC3WtQ (ORCPT + 99 others); Thu, 30 Mar 2023 18:49:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231303AbjC3WsJ (ORCPT ); Thu, 30 Mar 2023 18:48:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EE4810D; Thu, 30 Mar 2023 15:47:55 -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 ams.source.kernel.org (Postfix) with ESMTPS id 0A93CB82A64; Thu, 30 Mar 2023 22:47:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2721AC4339B; Thu, 30 Mar 2023 22:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680216449; bh=b6bjB25MmPt0K7AqRbN3VyoVhq1Q+MBc4F0mj39Eq+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kGpLiTL7Ra+oH3XkAYQirDufFcvhcz8FZTPmIca8UoHhoYcQCCWMdWvv1JEQk4IWw zq6o6j3z60LAuO5Xo0/cGbs464IjYTdi6TmNewgihH2jql4Wm82Y77oZK/EDooOGlB eMGc2kiaSaf2xB1afPNemrcDPrsfQSicoGt/sRLqFfqrNA/4Nd9fHa3WUaCnwsyWFD mxFLGAo1Q90p1rrCGEnhV+lpecMdJsmVH4zQnUw+UJqlQUJZTCtcxlx1Fn99LndgIO h0DC/DikuaHHF5DVTtOqFE1iQbx8jU5MSZAiwZezlRclQDzSsVgbdDpe+3PK5US/Gg 4EY12OzMHKtsA== Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 37532154048D; Thu, 30 Mar 2023 15:47:28 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, hch@lst.de, "Paul E. McKenney" , Sachin Sant , "Zhang, Qiang1" Subject: [PATCH rcu 17/20] srcu: Fix long lines in srcu_get_delay() Date: Thu, 30 Mar 2023 15:47:23 -0700 Message-Id: <20230330224726.662344-17-paulmck@kernel.org> X-Mailer: git-send-email 2.40.0.rc2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS 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 This commit creates an srcu_usage pointer named "sup" as a shorter synonym for the "ssp->srcu_sup" that was bloating several lines of code. Signed-off-by: Paul E. McKenney Tested-by: Sachin Sant Tested-by: "Zhang, Qiang1" Cc: Christoph Hellwig --- kernel/rcu/srcutree.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index f9dd6ed5503e..9699bcab7215 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -616,17 +616,18 @@ static unsigned long srcu_get_delay(struct srcu_struct *ssp) unsigned long gpstart; unsigned long j; unsigned long jbase = SRCU_INTERVAL; + struct srcu_usage *sup = ssp->srcu_sup; - if (ULONG_CMP_LT(READ_ONCE(ssp->srcu_sup->srcu_gp_seq), READ_ONCE(ssp->srcu_sup->srcu_gp_seq_needed_exp))) + if (ULONG_CMP_LT(READ_ONCE(sup->srcu_gp_seq), READ_ONCE(sup->srcu_gp_seq_needed_exp))) jbase = 0; - if (rcu_seq_state(READ_ONCE(ssp->srcu_sup->srcu_gp_seq))) { + if (rcu_seq_state(READ_ONCE(sup->srcu_gp_seq))) { j = jiffies - 1; - gpstart = READ_ONCE(ssp->srcu_sup->srcu_gp_start); + gpstart = READ_ONCE(sup->srcu_gp_start); if (time_after(j, gpstart)) jbase += j - gpstart; if (!jbase) { - WRITE_ONCE(ssp->srcu_sup->srcu_n_exp_nodelay, READ_ONCE(ssp->srcu_sup->srcu_n_exp_nodelay) + 1); - if (READ_ONCE(ssp->srcu_sup->srcu_n_exp_nodelay) > srcu_max_nodelay_phase) + WRITE_ONCE(sup->srcu_n_exp_nodelay, READ_ONCE(sup->srcu_n_exp_nodelay) + 1); + if (READ_ONCE(sup->srcu_n_exp_nodelay) > srcu_max_nodelay_phase) jbase = 1; } } -- 2.40.0.rc2