Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4807787rdb; Tue, 12 Dec 2023 09:48:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRx5IQ/IMIVb8kCBkRN076iXhi6UP4MPt0/5+f62mG77NoDim+eeEM2KXowj79Xy7tHGm5 X-Received: by 2002:a05:6a00:4585:b0:6ce:f5c5:46a with SMTP id it5-20020a056a00458500b006cef5c5046amr2183499pfb.16.1702403332922; Tue, 12 Dec 2023 09:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702403332; cv=none; d=google.com; s=arc-20160816; b=cMk9ta84ZxjQlD4ATtcu90jp7YH5XkjCo1XBdWtWgaAWm9/gsuMYLDYpmKPxSvSZan /UknT7iYrfnE7g2Jx0NV8cLdvJi0wFfz8T6CqPDi8Yy0LhlfFHxMeQk7nhW+JuZcFwKT jCwnv+3cPnMV+6AoRyP/4yYM3er8+Xv82wVwHjHVJtZuM80uLVek4Wf51r3hhurde+ja JsGL7SHpn4rX9+tgJeS/jD3iFgHbNGnQGnvzvUClp5r6I5PFAWPGisEuUHij9dARMsS6 s1PB+Ps/X4QUu+/wfA+Ine5ddl596JdzTyNivzcLb+YWYpBqr8Qjb4DVBz3j5yW21Q1y yKUQ== 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=G3OUBl8PInHDk+EeLZROk+XnMSbBZv0NI2vC5EMY4Yw=; fh=ZedRXVYcT7kvjPubr16ngBepTPHtJENPSWnZ412hF9g=; b=y4+MSL8TNzELfkAIslCttfNzycDyyMSUkgdDazL8+qNR1e5im8aJVlzw5htonS6GZS T3OysRjtz/IJPtRU+gnhjQbfDYbGtsDlAzMb8+9Zmw2MswArTyPN7CI5yLiLeHpvGe/w OOI/x84eUH6Q167HqTy2SmNy2Hs1GblL3JxJhZIIAaf6TwtK2YKlPlVRoaYAMBq3ClLV L/kiDGbmgJ6sdjGYjZ8L2MWmvrXoWCZO6z+SRDtVEW5hcvla9J8F9BDJoXE3flbmbJeQ LndRzEKiaz8dXWVo3/KcAJHVRwUkOQHQV6qdC0jphRAl5bCyiSICpHCWDDAKgLoVT5xN y1xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LrBqFtUI; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id i2-20020a63e902000000b005c6fd5f1856si7002009pgh.363.2023.12.12.09.48.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:48:52 -0800 (PST) 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=@gmail.com header.s=20230601 header.b=LrBqFtUI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 84E538048686; Tue, 12 Dec 2023 09:48:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376796AbjLLRsl (ORCPT + 99 others); Tue, 12 Dec 2023 12:48:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233101AbjLLRsk (ORCPT ); Tue, 12 Dec 2023 12:48:40 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B47793; Tue, 12 Dec 2023 09:48:46 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1d0897e99e0so34891605ad.3; Tue, 12 Dec 2023 09:48:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702403325; x=1703008125; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G3OUBl8PInHDk+EeLZROk+XnMSbBZv0NI2vC5EMY4Yw=; b=LrBqFtUIqrqlAHsZbfsBEkG9PjuhmY5wlIwoex3KxtuVFIKSnBb0bqR68bq9vGZJ3M fZDseTr+tzsi4bHzPte8i9kYIzKUJl5qmTVksXLa0cZ1kN4sfXwU3+FxT0GB/7c1CsMW jWG1HanLRDasQcWf/s/3tVvd6msWwU5OnyMg2EmuAIwvQTv3rUJyyrXbsYlOQPyoY0qP HEQwIIbQA13vqwo8DLKmuOvyFADfogSD85UIhYTN1VmOeOnnEFLevac5hyXh5CzzQesB Ftyi8y50nFLiHy2jGo0TT5HVz0w58IVeBptLZnf4UxLnTZBctYv7D1x382aVQyqHNH00 EPHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702403325; x=1703008125; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G3OUBl8PInHDk+EeLZROk+XnMSbBZv0NI2vC5EMY4Yw=; b=aNWnmMw465Vry9N5reDSxe+BYl8eNW3odestr5HUqOExWhUHAJOcD1qPn4EUiVDPkz PzUTDZQbHIE5PvFtdUnh/9YL+3mKS85RBuwC+3k5RkdRISJPAED4o9hKkedR5XHlLg0r cfwi7YK1VEe4ODZMQC931m/P1UL0EbopODuHuhWxYrorr2Le37gvom3f8h5Be491SPBN C71Z35d7JHr4jWHfiJICL8aywWf5No6E8sf36w7P3TMu1YqU76YQVsYRii5aHAVCAxiP BqVoeVT+dG5dSTWl2YT6Wm9edhKGN/xfL0LIabBLTDB+ARVwtWGkDWMgtQ13G+OStOe1 CKVg== X-Gm-Message-State: AOJu0Yxp1fwkYwwEZ2GABStX6/Ubo+ezX88YHGrPCTGV+nGZ5FV6lGbi Xi+gkx1JaVkpchuY8Jv9q79QvYfIHWbg+Tuh X-Received: by 2002:a17:902:778c:b0:1d0:aeda:9ad5 with SMTP id o12-20020a170902778c00b001d0aeda9ad5mr3032883pll.34.1702403324689; Tue, 12 Dec 2023 09:48:44 -0800 (PST) Received: from localhost.localdomain ([101.0.63.152]) by smtp.gmail.com with ESMTPSA id l17-20020a170902eb1100b001d0b42fa98bsm8880871plb.4.2023.12.12.09.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:48:44 -0800 (PST) From: "Neeraj Upadhyay (AMD)" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, paulmck@kernel.org, Neeraj.Upadhyay@amd.com, Frederic Weisbecker , Yong He , Joel Fernandes , Neeraj Upadhyay Subject: [PATCH rcu 1/3] srcu: Remove superfluous callbacks advancing from srcu_gp_start() Date: Tue, 12 Dec 2023 23:18:15 +0530 Message-Id: <20231212174817.11919-1-neeraj.iitr10@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231212174750.GA11886@neeraj.linux> References: <20231212174750.GA11886@neeraj.linux> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 09:48:51 -0800 (PST) From: Frederic Weisbecker Callbacks advancing on SRCU must be performed on two specific places: 1) On enqueue time in order to make room for the acceleration of the new callback. 2) On invocation time in order to move the callbacks ready to invoke. Any other callback advancing callsite is needless. Remove the remaining one in srcu_gp_start(). Co-developed-by: Yong He Signed-off-by: Yong He Co-developed-by: Joel Fernandes Signed-off-by: Joel Fernandes Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney Co-developed-by: Neeraj Upadhyay (AMD) Signed-off-by: Neeraj Upadhyay (AMD) --- kernel/rcu/srcutree.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index 560e99ec5333..e9356a103626 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -772,20 +772,10 @@ EXPORT_SYMBOL_GPL(__srcu_read_unlock_nmisafe); */ static void srcu_gp_start(struct srcu_struct *ssp) { - struct srcu_data *sdp; int state; - if (smp_load_acquire(&ssp->srcu_sup->srcu_size_state) < SRCU_SIZE_WAIT_BARRIER) - sdp = per_cpu_ptr(ssp->sda, get_boot_cpu_id()); - else - sdp = this_cpu_ptr(ssp->sda); lockdep_assert_held(&ACCESS_PRIVATE(ssp->srcu_sup, lock)); WARN_ON_ONCE(ULONG_CMP_GE(ssp->srcu_sup->srcu_gp_seq, ssp->srcu_sup->srcu_gp_seq_needed)); - spin_lock_rcu_node(sdp); /* Interrupts already disabled. */ - rcu_segcblist_advance(&sdp->srcu_cblist, - rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); - WARN_ON_ONCE(!rcu_segcblist_segempty(&sdp->srcu_cblist, RCU_NEXT_TAIL)); - spin_unlock_rcu_node(sdp); /* Interrupts remain disabled. */ WRITE_ONCE(ssp->srcu_sup->srcu_gp_start, jiffies); WRITE_ONCE(ssp->srcu_sup->srcu_n_exp_nodelay, 0); smp_mb(); /* Order prior store to ->srcu_gp_seq_needed vs. GP start. */ -- 2.40.1