Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2733740rwb; Sun, 15 Jan 2023 21:34:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxqXoNSg08dVxtr5rbgyH7DTe9xso4nCKXFegzi4C+OuJCMm1RMauu/4OMMF7yrXi/qea1 X-Received: by 2002:a17:90b:3696:b0:229:989:4b30 with SMTP id mj22-20020a17090b369600b0022909894b30mr15011400pjb.46.1673847254849; Sun, 15 Jan 2023 21:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673847254; cv=none; d=google.com; s=arc-20160816; b=o16bubebNQRIzWHwZvcm5T27VOi206x0Ho3rGX//9vo5vXBAr413VpbJjYJ5r+ofVU aWvM6l+2vE+4zsy2Ar4Z7oYj2drbrg1UVibbxenjpcG66OCrc1ZcmPlKS3zHObR6bLb+ 40+HTqyH/xYg6tBECaYdv8UmzsnTJeDvCmq7RmFXYW1G7CbQgAlzT2IQuvM643TIPn8e I97R7TJlD4NbJWCE+Sfqus9UD8uN1xzAEW6+PHc8pms5cJ3buXxCgSH9aa52kt5aoVwI it1NR1iRSuGFF3Ch6Udhr8KIW54+5KZhP3nnxh6sC62zkMldMnDgYbvCOEtI3GGzmoqf AgaQ== 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=leG+FywPA8fQpfpqx17K0seTG6cnaQcQSScb+hGU99Q=; b=Qp7wWOAltMxWLELNGVnjvcvDF+sqVx+aBSqsTOlB3KwWH81j8cKA6Ci3EFcAZlK37A 4eTknB52Xx+rue5T6Xo9Z91JqrxyyhQXfyhY8leTtj7sb2Pw4xqbOw4jYaVcoDap5RC6 vHwZbkrUKvHeSPqiUCC7Uh2FM4YxWR7wA6ZP29wWlCDZFPPBW6J8IubKC/sZ0qUnomnV nIAwxQTIILtLQdxrMbfgHqCPX5efMXJeQRGhBYe5sQlJnECJ13JLdkGHiNw+S8wF8IoF BLAuUmrBcCyDe62hRNzX+pB0bKssMGfmwjQtFZQe5poA1cBibRBR2jqu5p+AhGlIdY+m lA2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZtOVNsEm; 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 h184-20020a6383c1000000b004cd1e13283fsi2094520pge.318.2023.01.15.21.34.08; Sun, 15 Jan 2023 21:34:14 -0800 (PST) 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=ZtOVNsEm; 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 S231845AbjAPE1C (ORCPT + 52 others); Sun, 15 Jan 2023 23:27:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231895AbjAPE0q (ORCPT ); Sun, 15 Jan 2023 23:26:46 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6112C72A9; Sun, 15 Jan 2023 20:26:40 -0800 (PST) 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 C3E69B80B8A; Mon, 16 Jan 2023 04:26:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7653FC433EF; Mon, 16 Jan 2023 04:26:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673843197; bh=U20J5YAsHE8av2PITxrTHMvpYfGswXbWZ0y/Ft6X5AY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=ZtOVNsEmMWlPIJ+TNtzGBZ10XNU3q/kIcAQJGdgOcX3Tz31LPe0C9UrWea9eXuMBy K4y57HGLuJ3Gn+QA8QxJdHEXHuqjvLH3jOJkiO4KKCMCuDBsreDPWnFZ97trejKX3k qrCNKBnMHHJ3iKLmYE4GOa93UjDraFPOPtOk/I73dqFXlKek+vYBmmAACksTP5RVsl xYbpjx6vZiSKsVMvOq+kD5JXcvh5oqa9rmb7+0t6nvnk+PeVMZyKHGT/Ij1GTxabH3 xtwnOyT6oAmrAmyfdL5xE99nYUve9BEHy5baHJaZKjsCcUzWqt83xszQxQ+1Y+K2Ki 0ODIWOr1/+bMg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 242CC5C05A0; Sun, 15 Jan 2023 20:26:37 -0800 (PST) Date: Sun, 15 Jan 2023 20:26:37 -0800 From: "Paul E. McKenney" To: Joel Fernandes Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Josh Triplett , Lai Jiangshan , Mathieu Desnoyers , rcu@vger.kernel.org, fweisbec@gmail.com, urezki@gmail.com Subject: Re: [PATCH v2 rcu/dev 1/2] rcu: Track laziness during boot and suspend Message-ID: <20230116042637.GO2948950@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20230112005223.2329802-1-joel@joelfernandes.org> <20230115162504.08ef72b0@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Sun, Jan 15, 2023 at 04:34:58PM -0500, Joel Fernandes wrote: > On Sun, Jan 15, 2023 at 4:25 PM Steven Rostedt wrote: > > > > On Thu, 12 Jan 2023 00:52:22 +0000 > > "Joel Fernandes (Google)" wrote: > > > > > -- a/kernel/rcu/update.c > > > +++ b/kernel/rcu/update.c > > > @@ -144,8 +144,45 @@ bool rcu_gp_is_normal(void) > > > } > > > EXPORT_SYMBOL_GPL(rcu_gp_is_normal); > > > > > > -static atomic_t rcu_expedited_nesting = ATOMIC_INIT(1); > > > +static atomic_t rcu_async_hurry_nesting = ATOMIC_INIT(1); > > > +/* > > > + * Should call_rcu() callbacks be processed with urgency or are > > > + * they OK being executed with arbitrary delays? > > > + */ > > > +bool rcu_async_should_hurry(void) > > > +{ > > > + return !IS_ENABLED(CONFIG_RCU_LAZY) || > > > + atomic_read(&rcu_async_hurry_nesting); > > > +} > > > +EXPORT_SYMBOL_GPL(rcu_async_should_hurry); > > > + > > > +/** > > > + * rcu_async_hurry - Make future async RCU callbacks not lazy. > > > + * > > > + * After a call to this function, future calls to call_rcu() > > > + * will be processed in a timely fashion. > > > + */ > > > +void rcu_async_hurry(void) > > > +{ > > > + if (IS_ENABLED(CONFIG_RCU_LAZY)) > > > + atomic_inc(&rcu_async_hurry_nesting); > > > +} > > > +EXPORT_SYMBOL_GPL(rcu_async_hurry); > > > > > > > Where do you plan on calling these externally, as they are being > > marked exported? > > > > If you allow random drivers to enable this, I can see something > > enabling it and hitting an error path that causes it to never disable > > it. > > You mean, just like rcu_expedite_gp() ? > > > I wouldn't have EXPORT_SYMBOL_GPL() unless you really know that it is > > needed externally. > > At the moment it is not called externally but in the future, it could > be from rcutorture. If you see rcu_expedite_gp(), that is exported > too. I was just modeling it around that API. It really should be invoked from rcutorture for testing purposes. In current -rcu, TREE01 enables LAZY_RCU, so we are finally getting coverage (aside from my manual enablement on part of the test grid that I use). So we need that export. On the other hand, wasn't there some talk recently of targeted exports? If that comes to pass, this could be exported to only rcutorture and rcuscale. Thanx, Paul > thanks, > > - Joel > > > > > -- Steve > > > > > > > +/** > > > + * rcu_async_relax - Make future async RCU callbacks lazy. > > > + * > > > + * After a call to this function, future calls to call_rcu() > > > + * will be processed in a lazy fashion. > > > + */ > > > +void rcu_async_relax(void) > > > +{ > > > + if (IS_ENABLED(CONFIG_RCU_LAZY)) > > > + atomic_dec(&rcu_async_hurry_nesting); > > > +} > > > +EXPORT_SYMBOL_GPL(rcu_async_relax); > > > + > > > +static atomic_t rcu_expedited_nesting = ATOMIC_INIT(1);