Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1475232rwl; Fri, 31 Mar 2023 11:40:41 -0700 (PDT) X-Google-Smtp-Source: AKy350aGPBVDzaSHRn5Pp4pZZhgtBxi3Yq9uYXRvNX6tDe5oFkH8ksQ80eSCuzP0DVKdvMh9w7lk X-Received: by 2002:a17:902:7593:b0:1a2:8871:b430 with SMTP id j19-20020a170902759300b001a28871b430mr7112459pll.2.1680288040849; Fri, 31 Mar 2023 11:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680288040; cv=none; d=google.com; s=arc-20160816; b=CAnoUmAVkuZchny4zbzSLxNmVyBhDxLQTpNitftRBh1cPH1+m55Kwh4E+2UXanhQ25 vCNuULnhgrEp12dgli7DzKpROya6GazPcXuxQejQihOIC2dyXkCPb93kbqptS+A6Kdm/ YwU4Bmn59UPF4yinD3cL/29/yYNWf7EPCQL5JP3otAi8T/+ulVANibZRK2nRwv1uRmW4 QLK+gdwBpJrZLyRxZsZUoYYDTl/cnW2ua+FjRVh19Mtr9AqCjHNGe/ks9zGRraCLdORd 6kCEt+ng20q4Lz7/WM9zISGBdUWZpVprDClx+etNYwOMFLH16+WQb3N7V9XeKX2Mp59o r+QA== 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=6JSm5mY+H8cgws6A2hr7PcftPqLEY0bV4CiBwT19cGs=; b=raobQbdWiLzsEOh69vw1+VCIO7OwbjLapmhQMP2fP79wf6N0/svr3ZONAZDUgterwj 67HNyQarS1XNGfgs6dM/x+wwbYhEi8DiLzUm8Kx+urZg9Hcxxs82ai+eZRrDemPs4SE5 Hwz2XxcWYqit/Og/6K786gqVzeYEpMzJNbZ76mCq/TdfpDiW33Op5/BpriKfzEW7W2Lp eEoLfgk930PrsNqQTPQYE4q+W5kSc7U3oUVTjXWPlsuLabTS9KI7mklugCZ7clGB9M09 FK1w2LoNRktH6TFRCj8Hs5vvuL6hmleso78y8Zv/yfOFPXOjPE6lrl369UXfFngdsCAj zfMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fBJAAtHb; 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 l9-20020a170903244900b0019cdd3e2aecsi2852078pls.312.2023.03.31.11.40.29; Fri, 31 Mar 2023 11:40:40 -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=fBJAAtHb; 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 S231775AbjCaSfl (ORCPT + 99 others); Fri, 31 Mar 2023 14:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjCaSfj (ORCPT ); Fri, 31 Mar 2023 14:35:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BA931C1FD; Fri, 31 Mar 2023 11:35:39 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CDA6262AED; Fri, 31 Mar 2023 18:35:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D77DC433D2; Fri, 31 Mar 2023 18:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680287738; bh=79aOJ1giHYcfqq27B0ApvLldLxW67XdeeGemRyFtgUg=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=fBJAAtHbweslyvxiUdUqMPJUntejV1ohdCqfFsfBtxy1XAVb70FD0hzsvLRz6/vCY 1UAdzEF/fIdR6vQBEeAOA8YQCZ0qjJrpqe2EV0ZHHuUlM9hkt8UJr4cnTHKsHGlML9 IDdFqN1yEE6upAouCP8d8tqzWPqgnYzWfmmXnpf+HB3arUxeAXiPfQSc2wmPJ31TpH a3tYftweC+aGQeXJ5JEwa2PU6JtxNajYtDgzPcW8wCYGhRAPxLjyxYWyvVgFi1xKs8 kXcI/Uz/mksN43MOAH0kHeBvG9hxGcWXCeoHDVSAanMzqBhIVd4CTIDBMGoia6rYER mhVq7Msdvdxwg== Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id CA1121540476; Fri, 31 Mar 2023 11:35:37 -0700 (PDT) Date: Fri, 31 Mar 2023 11:35:37 -0700 From: "Paul E. McKenney" To: Frederic Weisbecker Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, hch@lst.de, kernel test robot Subject: Re: [PATCH rcu 01/20] rcu-tasks: Fix warning for unused tasks_rcu_exit_srcu Message-ID: <5e63ebc8-0292-457a-b0ce-c9a8ba4ef699@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20230330224726.662344-1-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 On Fri, Mar 31, 2023 at 01:58:38PM +0200, Frederic Weisbecker wrote: > On Thu, Mar 30, 2023 at 03:47:07PM -0700, Paul E. McKenney wrote: > > The tasks_rcu_exit_srcu variable is used only by kernels built > > with CONFIG_TASKS_RCU=y, but is defined for all kernesl with > > CONFIG_TASKS_RCU_GENERIC=y. Therefore, in kernels built with > > CONFIG_TASKS_RCU_GENERIC=y but CONFIG_TASKS_RCU=n, this gives > > a "defined but not used" warning. > > > > This commit therefore moves this variable under CONFIG_TASKS_RCU. > > > > Link: https://lore.kernel.org/oe-kbuild-all/202303191536.XzMSyzTl-lkp@intel.com/ > > Reported-by: kernel test robot > > Signed-off-by: Paul E. McKenney > > --- > > kernel/rcu/tasks.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h > > index bfb5e1549f2b..185358c2f08d 100644 > > --- a/kernel/rcu/tasks.h > > +++ b/kernel/rcu/tasks.h > > @@ -136,8 +136,10 @@ static struct rcu_tasks rt_name = \ > > .kname = #rt_name, \ > > } > > > > +#ifdef CONFIG_TASKS_RCU > > /* Track exiting tasks in order to allow them to be waited for. */ > > DEFINE_STATIC_SRCU(tasks_rcu_exit_srcu); > > +#endif > > Reviewed-by: Frederic Weisbecker Thank you! I will apply this on my next rebase. > BTW should exit_tasks_rcu_start/stop() be defined as static inline stubs > whenever !CONFIG_TASKS_RCU ? Currently: > > * if CONFIG_TASKS_RCU_GENERIC=n, the stubs are as usual (static inline) > > * if CONFIG_TASKS_RCU_GENERIC=y && CONFIG_TASKS_RCU=n, then the stubs are > defined as empty linked function (is the compiler smart enough to remove > the empty call?) Good point! They are currently defined as static inline only if there are no RCU Tasks flavors built into the kernel, so if there was (say) RCU Tasks Trace but no RCU Tasks, these functions would needlessly be actual calls to empty functions. I am not sure that there are any kernels built like this, and this is not on a fastpath, but I would welcome a patch that made this more precise. Testing will require a few kernel builds, though. ;-) Thanx, Paul