From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755261AbbEFGJW (ORCPT ); Wed, 6 May 2015 02:09:22 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:55134 "EHLO e39.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751935AbbEFGJU (ORCPT ); Wed, 6 May 2015 02:09:20 -0400 Date: Tue, 5 May 2015 23:09:14 -0700 From: "Paul E. McKenney" To: josh@joshtriplett.org Cc: Nicolas Iooss , Steven Rostedt , Mathieu Desnoyers , Lai Jiangshan , linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu: make rcu_*_data variables static Message-ID: <20150506060914.GA5381@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150505055544.GK5381@linux.vnet.ibm.com> <1430834226-2028-1-git-send-email-nicolas.iooss_linux@m4x.org> <20150505232558.GB16688@cloud> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150505232558.GB16688@cloud> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15050606-0033-0000-0000-0000046CFD83 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 05, 2015 at 04:25:58PM -0700, josh@joshtriplett.org wrote: > On Tue, May 05, 2015 at 09:57:06PM +0800, Nicolas Iooss wrote: > > rcu_bh_data, rcu_sched_data and rcu_preempt_data are never used outside > > kernel/rcu/tree.c and thus can be made static. > > > > Doing so fixes a section mismatch warning reported by clang when > > building LLVMLinux with -Wsection, because these variables were declared > > in .data..percpu and defined in .data..percpu..shared_aligned since > > commit 11bbb235c26f ("rcu: Use DEFINE_PER_CPU_SHARED_ALIGNED for > > rcu_data"). > > > > Signed-off-by: Nicolas Iooss > > Reviewed-by: Josh Triplett Applied, thank you both! > Nice improvement. > > Minor nit: since these are only one line each now, they don't really > need a blank line between them, but *shrug*. I don't mind the grouping implied by the blank lines, but I agree that it is close to the edge. Thanx, Paul > > --- > > kernel/rcu/tree.c | 2 +- > > kernel/rcu/tree.h | 3 --- > > 2 files changed, 1 insertion(+), 4 deletions(-) > > > > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c > > index 233165da782f..e4a607fc5ad0 100644 > > --- a/kernel/rcu/tree.c > > +++ b/kernel/rcu/tree.c > > @@ -91,7 +91,7 @@ static const char *tp_##sname##_varname __used __tracepoint_string = sname##_var > > > > #define RCU_STATE_INITIALIZER(sname, sabbr, cr) \ > > DEFINE_RCU_TPS(sname) \ > > -DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, sname##_data); \ > > +static DEFINE_PER_CPU_SHARED_ALIGNED(struct rcu_data, sname##_data); \ > > struct rcu_state sname##_state = { \ > > .level = { &sname##_state.node[0] }, \ > > .rda = &sname##_data, \ > > diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h > > index a69d3dab2ec4..0c32f730d033 100644 > > --- a/kernel/rcu/tree.h > > +++ b/kernel/rcu/tree.h > > @@ -519,14 +519,11 @@ extern struct list_head rcu_struct_flavors; > > * RCU implementation internal declarations: > > */ > > extern struct rcu_state rcu_sched_state; > > -DECLARE_PER_CPU(struct rcu_data, rcu_sched_data); > > > > extern struct rcu_state rcu_bh_state; > > -DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); > > > > #ifdef CONFIG_PREEMPT_RCU > > extern struct rcu_state rcu_preempt_state; > > -DECLARE_PER_CPU(struct rcu_data, rcu_preempt_data); > > #endif /* #ifdef CONFIG_PREEMPT_RCU */ > > > > #ifdef CONFIG_RCU_BOOST > > -- > > 2.3.6 > > >