Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4807868rdb; Tue, 12 Dec 2023 09:49:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOU+83XdU7Jh7mqVtn+CPO/4HrAp8O2muD9vyMDRkPN+v24xqTyApGJV9pVT0QUxwjdK7U X-Received: by 2002:a17:903:2441:b0:1cf:aff5:8934 with SMTP id l1-20020a170903244100b001cfaff58934mr3474339pls.48.1702403344682; Tue, 12 Dec 2023 09:49:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702403344; cv=none; d=google.com; s=arc-20160816; b=pE7sloXoMRqrnKrU6DosfXs9BQCPecDLbLjLnCBit2fjpJSYwWcfN6vEvSHJOT7rLN BoXA1qLSY02fyprdz1swzHjpUy+LDZILAZFC5FNv4ES5MgtALLfS03iJCkYfM1azn1Kg YNEhDYy9mRHEEpiuBGQa1MpY5TNXrH1a2Drj/MFebLXcekDg0vEcsh22zOAWKdd/yBbG UJA26JP6ckWz8ai7MUMwJLvlZrpsFmfgl89Ww7X7hnsqqYqO41JLEo8lLr6XLcERUElW 2FaA+jEBpr09wdkqtlGB4p+Xpha+uwqnQcf11b4nYhXIUFMUuNgYsTXWfiS/JO3Fxgj+ LXPw== 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=nkU8r/Y5CKJ4k3AvWmhHYljnGizcb7g2Kv2I06R4LwY=; fh=pzbLb0fcCHx9ApyLXWRXZlvnkZ5E+WgEJFHBfDnIwGU=; b=JEJSeP1sw1E6CCtfzKncpGAnhkaPn/HswFTlfPaZwTyx1eccVDON8gr5Rz7vYHl5/D JYmc+cXI7YfIrRKNebN3D9N8krtxiBZo4SiSCdL9yJ57OjlA+vGuRVDpfYmD91pMCeiw qvy6Obk7BdSGhOGNARahGllNTsYspaBm7zxWrBvRXOG81iNYl1FCyT8V0uZhJfzkWT6X C0eDyKQYkGtOy2vJLKXtwzZsxa/zJbsBIzHEeXQmh8FJ1q/4HLRXEriAk5l1iLl0kGot ZBPNAe5mm2GW9GXCRQuOljeC+3gD5G9zv0og/kPTU9b6FhPAYuDCXq6n0c2YUfqTb6C8 DWww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=R8bc4Bio; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u14-20020a17090341ce00b001d07136f5f7si8276375ple.483.2023.12.12.09.49.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:49:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=R8bc4Bio; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id E71A380A87EC; Tue, 12 Dec 2023 09:48:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376796AbjLLRsp (ORCPT + 99 others); Tue, 12 Dec 2023 12:48:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377004AbjLLRsn (ORCPT ); Tue, 12 Dec 2023 12:48:43 -0500 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D641F83; Tue, 12 Dec 2023 09:48:49 -0800 (PST) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1d03bcf27e9so36314725ad.0; Tue, 12 Dec 2023 09:48:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702403329; x=1703008129; 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=nkU8r/Y5CKJ4k3AvWmhHYljnGizcb7g2Kv2I06R4LwY=; b=R8bc4BioBTYCMyz2DdyJKXZxZto0bYhdEGMIVbRg/2WIAWTx70VeICDRfvyC8ZCdrH bo3naoCTbDqHq3yQf7WuqYTQYy/H5GbUcNsx76Dqd2eVjy+630l2bJRx+kDY8L1o++Fg bk6wSFEG5Frv84S6CQwxk70qwElT3Exe7bea8coYkmOxzTRyIYFmIaMwO55NXxscSeCH u8X14cjAMt9PJIHNp6nuL76Z16izXYqXiolnfbhBkZO1e8Ph+RAton2nDd52sOI2GJWj Be3DWOCcL9O9jbfq41LYIlE/kuKhEl4SvYeYgMOr1wU2cTHXRyLxAjxuhcT+MVm8nBjD S/5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702403329; x=1703008129; 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=nkU8r/Y5CKJ4k3AvWmhHYljnGizcb7g2Kv2I06R4LwY=; b=bOpk5EbtREP1fvFxdmoexCV0JnxB9v1ABtm7q9qiOnnnbWM0eBuPQOOYJyibB+CKo2 x1YHNOvBLCqo/3LbfHClAiFRnuXkTc2xuQ2x5eLFG/feCqxhssX/nlkpot4iq6adqtkM UFhdbxtz93tEWlv2oROkXVo7h/60gPcD/enPIVZ7jMxNpYF3tbZpTZyjcAghat+yvLe4 EQ2lublm3OJhNsKKQ4ozMAZmbPTQ85gs+XrQMx6NbbQ6xCZoLxNqjKsWD8WKr4Na0aKg 0FLsYXUhEzXYRgT3A91ImABqLMFWItnb56Er2lz7GKajXbRFqzQmjVlc3rxxo6+Exs/c pC4g== X-Gm-Message-State: AOJu0Yyu/yCkWAo/RZ+ET70AoN8cgfEKkTk8Z+YCSquHoUcPCiL0b8kP h1Z4WuzW/eHf1BQc0k5juaSoLHRs4MMsIaCd X-Received: by 2002:a17:902:e752:b0:1d0:b926:bbcd with SMTP id p18-20020a170902e75200b001d0b926bbcdmr4343131plf.54.1702403328722; Tue, 12 Dec 2023 09:48:48 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 09:48:48 -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 , Joel Fernandes , Neeraj Upadhyay Subject: [PATCH rcu 2/3] srcu: No need to advance/accelerate if no callback enqueued Date: Tue, 12 Dec 2023 23:18:16 +0530 Message-Id: <20231212174817.11919-2-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=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 12 Dec 2023 09:48:59 -0800 (PST) From: Frederic Weisbecker While in grace period start, there is nothing to accelerate and therefore no need to advance the callbacks either if no callback is to be enqueued. Spare these needless operations in this case. Signed-off-by: Frederic Weisbecker Reviewed-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Neeraj Upadhyay (AMD) --- kernel/rcu/srcutree.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/srcutree.c b/kernel/rcu/srcutree.c index e9356a103626..2bfc8ed1eed2 100644 --- a/kernel/rcu/srcutree.c +++ b/kernel/rcu/srcutree.c @@ -1261,9 +1261,11 @@ static unsigned long srcu_gp_start_if_needed(struct srcu_struct *ssp, * period (gp_num = X + 8). So acceleration fails. */ s = rcu_seq_snap(&ssp->srcu_sup->srcu_gp_seq); - rcu_segcblist_advance(&sdp->srcu_cblist, - rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); - WARN_ON_ONCE(!rcu_segcblist_accelerate(&sdp->srcu_cblist, s) && rhp); + if (rhp) { + rcu_segcblist_advance(&sdp->srcu_cblist, + rcu_seq_current(&ssp->srcu_sup->srcu_gp_seq)); + WARN_ON_ONCE(!rcu_segcblist_accelerate(&sdp->srcu_cblist, s)); + } if (ULONG_CMP_LT(sdp->srcu_gp_seq_needed, s)) { sdp->srcu_gp_seq_needed = s; needgp = true; -- 2.40.1