Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp967241rwl; Fri, 31 Mar 2023 05:08:20 -0700 (PDT) X-Google-Smtp-Source: AKy350b8TxQkwEX/mrJMEY94LxZ2lZ4J6eVdNUB/XejiCd6vrrkNE6b8CP2Xe3yfcnfh0FQCGonf X-Received: by 2002:a17:906:5307:b0:933:2e79:4632 with SMTP id h7-20020a170906530700b009332e794632mr21204803ejo.1.1680264500329; Fri, 31 Mar 2023 05:08:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680264500; cv=none; d=google.com; s=arc-20160816; b=oBKeiCZ4UGQADTVtlD0qkQzJmoZCSV2YZEKEUurpkg+R75gjZ71PoPD2BfFR63v0ud RWCOHXBJF3DBy0hWSRTxN+KK3bPDRzyK+0HtBq2aV7WtnrsZKxc3P8PsVdgwmvNv7SGm aB26nQTGWui7l7JrnhLQmpOa0go6x94CrD1XzB/bMIOAnnGF40rgwm/B7eTjYpMrFfIb 0pb2NB4Pi1XLSte2owHzmSUFozzJmyXzuyWJKABSrRPQXPoGgsIyAPG3cYf5fg/hXEi/ bm9i1mxJw4BrHdUsZ9TvbJdkfoCHEW1SqemwmI82y/ldVjNKYUZqa8/fqh6NJ0A7fJTE iWEQ== 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:message-id:subject:cc:to:from:date:dkim-signature; bh=oXbC5o69v8+M5M5Is1HI0GGTWRCBe4xRUiUWNKWkiCs=; b=A35Ory7zyY7Y1E/8+bQoUO1y6rOVUqCCftyzFP0oRZKg0iEddouEAvLzeZZpqjLL+8 uVaOn/I5g0VgVWTmdfy+U8sxisJqevCLWvPd3bU5MO+7KODa6PWczCfv+bTm/n6Z2Stw nTpH3hLHj+lkCHjHiuDgcqTQvTWzGA8eYUBBeOLk8XgWEgarxzcaOZ4Sk39LOclY4TpQ ZKwWIAWgC3yBQ8DdgASOR3jq/ZPyAa5RjG4RzOq6MHAU5XDVfqrmdVCzQEgl1I3ubs6k L83i7HZ+idSVAj9nEVEKhPLUaJDYEKupOAvk3UOGsZyo4OnWXh/w1AxH/mF/KYfunh4U p8oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="RQEz+j/A"; 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 kw7-20020a170907770700b0093959594e50si1578728ejc.248.2023.03.31.05.07.40; Fri, 31 Mar 2023 05:08:20 -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="RQEz+j/A"; 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 S231694AbjCaL6o (ORCPT + 99 others); Fri, 31 Mar 2023 07:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230491AbjCaL6n (ORCPT ); Fri, 31 Mar 2023 07:58:43 -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 073091C1D9; Fri, 31 Mar 2023 04:58:42 -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 976406284C; Fri, 31 Mar 2023 11:58:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC694C433D2; Fri, 31 Mar 2023 11:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680263921; bh=n6gp7VEqq1z42XgDqkPrn3j/xK6NXlXyi6C5HXOWE3Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RQEz+j/AUUdBZH5mLL5wREYzKN6XBew67mxpV3n2DqX7DbTemV4wNb5OWB0dYK5LQ f/rDHbXeWnYNC1AoSCsRlCRyccBTL2/st1hr9obLEdDT8Jee9xUzoP3+gpp6rvMPoG rSayQCB+OoPBqFNv2meXlqnLwlx8gS4xhHv8G8G52h9uKSI4y6wry4Q6YDxhecyeaD FTtxfGRkUgBXVottSe36FnJgBZ1B9s13C4tdnse324Q4vCx4b2vJyth+AGwhKM25aC yzW/FCOm/bIVQvmV1FP3NMSkjOB82t6h63AOSiA8xwQ6QZKGL1CbIsdozLdfq5fiix f8iCeFGIAM4KA== Date: Fri, 31 Mar 2023 13:58:38 +0200 From: Frederic Weisbecker To: "Paul E. McKenney" 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: References: <20230330224726.662344-1-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230330224726.662344-1-paulmck@kernel.org> X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 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 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?)