Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4977956rdb; Tue, 12 Dec 2023 15:22:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IEV0TRcrFXWgRFIGh2JOpvxL/Ppmpd7z0vaNBLK2v3sek1GzLAKNsOQy4m+4wf3zvpeSsyS X-Received: by 2002:a05:6e02:214d:b0:35d:5fc7:f54e with SMTP id d13-20020a056e02214d00b0035d5fc7f54emr11390933ilv.36.1702423378046; Tue, 12 Dec 2023 15:22:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702423378; cv=none; d=google.com; s=arc-20160816; b=T/2rYZ54UP0DqMPnl+Kxt0fnoYPuplLR4Ler4stYLYcxMIxLFZiFlsVMLzW9pdme0u tdNhJH5Hogwf5Cqlz9PFGvh/141+jdK1mbv7Hgc/sETK8GkQJ/TVAeh58a4osxyl6r7m T3uPGkRfjDs2zFze03rrBqT/ZwduwMCw582427BYn2Od708HGsdIn2elGj0RvRcxneC1 xTVIohN4aQJ8DQRTMZiZ9dm/MFZqsFP6DTYEAuPRLTLLEkO6FD1bPbuIpFctgabjES6F aGHxa5PVs2QSwM3hTaQ4ABxKX57nnYNj7kV9wduIYMR3Eqmb62nycFWpYAoJEiqDIGNV cmKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=no1hU0qMSuRSxx9sOYrSnjnOEvLJ8QjMRFYjlFqCCek=; fh=UFOFuRcibkD7xcsO5cVfuSLj9CPvi4GhDiZGuf8xTGA=; b=Ch4h4jwkDqADz6ThQcj+GlnYNJRVEQ36ot9K6CaOuLnHVBaMKVZXNcN2N85b+8oryk dsC/MR+iCKC5PR4j4N7wOcyILkSdNOxmb4y0AZE0mUZUy4Jay4cxDlvVTlhyX7okX0D9 bz74nIDo7oiroxMdwJx20IXeiZdkcYhCMGfEg9N4Ipx92kahUYgumrBPi/9bASZ4d3ts kJs+cUh/ZqRt9yk0wGAXtf4Wl+blUrNOEx9cSYmY+OSzJlfFMae9PkYsuFzH9s0lsBxh TasBcEnMP2rTYU8XP4ErEoisGy9q96+lxS6V0I1RqJ7kpmNCHNJCLUlLTzsflFXjasrO 4glQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=BEj3u0tv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id s62-20020a635e41000000b005c661f155fesi8269260pgb.377.2023.12.12.15.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 15:22:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=BEj3u0tv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B6D7B8025422; Tue, 12 Dec 2023 15:22:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377958AbjLLXWl (ORCPT + 99 others); Tue, 12 Dec 2023 18:22:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232588AbjLLXWk (ORCPT ); Tue, 12 Dec 2023 18:22:40 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46217AA for ; Tue, 12 Dec 2023 15:22:46 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c9f099cf3aso94629171fa.1 for ; Tue, 12 Dec 2023 15:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; t=1702423364; x=1703028164; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=no1hU0qMSuRSxx9sOYrSnjnOEvLJ8QjMRFYjlFqCCek=; b=BEj3u0tvCRJPFXhezmen454eoyW4Gw3Ci8nPnHkqKMDX7zeDl1M2JpN/rb0gzbTIyG bKb7HwyfFjr+zpnPVLrncekK0bbPDhVmWZHCepZ0iLz8b3OvOqWPq9TN8WW+jpw5jwWe RoQrVZTve7mhbHQW/RWPrZIre1blC057jLs5s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702423364; x=1703028164; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=no1hU0qMSuRSxx9sOYrSnjnOEvLJ8QjMRFYjlFqCCek=; b=sKinmKqkY3E8H3/Qz52t9QI6RJo3yfmkBzqLoDZ8JlIcxWkfWS7KCMm4rpmPWRrFUO vvH647cfMCIvPT7L54zPkhnofEnCFL5dR2Rj9r6uIvcWXa3sqwEA7rJe+ALkDVOxHbUd OgMOWHCdlkrIsQKjuqih6EumJb3r8nnKjNUQamm8DAH63RKm2DPOwv9BfdzM5a00/ZII fEipTqF/NuFnAxIzn3ayvDfFzmbHwswtEV8w8C4b73RohRGNXDtzfk/dStQ70XfouQ7w jDOcm8I9Bn4q0ORKzm3qo6DwyLlBWeseMfTs4HPcOuDkwgSNzEIu1lGHJd3om29RekJj FE9Q== X-Gm-Message-State: AOJu0YwaiDDQhBI0H2HvVHGEJmmhFxk+lOqTu9bU3FGcbzG7ny0zXi+t 5jZeSLIO12wXQGsFXpn1dNb/3oASkscmQYFxW3neyQ== X-Received: by 2002:a2e:a808:0:b0:2cc:1ec0:a75a with SMTP id l8-20020a2ea808000000b002cc1ec0a75amr4618551ljq.104.1702423364396; Tue, 12 Dec 2023 15:22:44 -0800 (PST) MIME-Version: 1.0 References: <20231212173948.GA11724@neeraj.linux> <20231212174004.11754-3-neeraj.iitr10@gmail.com> In-Reply-To: <20231212174004.11754-3-neeraj.iitr10@gmail.com> From: Joel Fernandes Date: Tue, 12 Dec 2023 18:22:33 -0500 Message-ID: Subject: Re: [PATCH rcu 3/3] rcu: Force quiescent states only for ongoing grace period To: "Neeraj Upadhyay (AMD)" Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, paulmck@kernel.org, Neeraj.Upadhyay@amd.com, Zqiang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLACK autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 12 Dec 2023 15:22:55 -0800 (PST) On Tue, Dec 12, 2023 at 12:40=E2=80=AFPM Neeraj Upadhyay (AMD) wrote: > > From: Zqiang > > If an rcutorture test scenario creates an fqs_task kthread, it will > periodically invoke rcu_force_quiescent_state() in order to start > force-quiescent-state (FQS) operations. However, an FQS operation > will be started even if there is no RCU grace period in progress. > Although testing FQS operations startup when there is no grace period in > progress is necessary, it need not happen all that often. This commit > therefore causes rcu_force_quiescent_state() to take an early exit > if there is no grace period in progress. > > Note that there will still be attempts to start an FQS scan in the > absence of a grace period because the grace period might end right > after the rcu_force_quiescent_state() function's check. In actual > testing, this happens about once every ten minutes, which should > provide adequate testing. > > Signed-off-by: Zqiang > Signed-off-by: Paul E. McKenney > Signed-off-by: Neeraj Upadhyay (AMD) > --- > kernel/rcu/tree.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > index 3ac3c846105f..1ae851777806 100644 > --- a/kernel/rcu/tree.c > +++ b/kernel/rcu/tree.c > @@ -2338,6 +2338,8 @@ void rcu_force_quiescent_state(void) > struct rcu_node *rnp; > struct rcu_node *rnp_old =3D NULL; > > + if (!rcu_gp_in_progress()) > + return; Reviewed-by: Joel Fernandes (Google) (Probably no need to resend with the tag, just update the patch in the PR). Thanks.