public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Josh Triplett <josh@joshtriplett.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
	laijs@cn.fujitsu.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, Valdis.Kletnieks@vt.edu,
	dhowells@redhat.com, edumazet@google.com, darren@dvhart.com,
	fweisbec@gmail.com, sbw@mit.edu
Subject: Re: [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs
Date: Tue, 21 May 2013 14:09:57 -0700	[thread overview]
Message-ID: <20130521210957.GV3578@linux.vnet.ibm.com> (raw)
In-Reply-To: <20130521173140.GA3878@jtriplet-mobl1>

On Tue, May 21, 2013 at 10:31:41AM -0700, Josh Triplett wrote:
> On Mon, May 20, 2013 at 07:58:20AM -0700, Paul E. McKenney wrote:
> > From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > 
> > TINY_RCU's reset_cpu_stall_ticks() and check_cpu_stalls() functions
> > are defined unconditionally, and are empty functions if CONFIG_RCU_TRACE
> > is disabled (which in turns disables detection of RCU CPU stalls).
> > These empty functions can add a bit of bloat to TINY_RCU, so this
> > commit reworks the ifdefs so that these functions are defined only
> > if they actually do something.
> > 
> > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> 
> Strange.  Both of these functions are static, and called in only one
> place, so shouldn't the compiler inline them (and thus throw them away
> completely when empty)?  Why does it not do so?

Good point for most architectures.  But given Tiny RCU's purpose, it
should allow for stupid compilers.  And I do need to fix the commit
message to call out the other benefit, namely saving a couple of
lines of source code.

							Thanx, Paul

> - Josh Triplett
> 
> > ---
> >  kernel/rcutiny.c        | 4 ++--
> >  kernel/rcutiny_plugin.h | 6 ++----
> >  2 files changed, 4 insertions(+), 6 deletions(-)
> > 
> > diff --git a/kernel/rcutiny.c b/kernel/rcutiny.c
> > index 4adc9e2..aa34411 100644
> > --- a/kernel/rcutiny.c
> > +++ b/kernel/rcutiny.c
> > @@ -204,7 +204,7 @@ static int rcu_is_cpu_rrupt_from_idle(void)
> >   */
> >  static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
> >  {
> > -	reset_cpu_stall_ticks(rcp);
> > +	RCU_TRACE(reset_cpu_stall_ticks(rcp));
> >  	if (rcp->rcucblist != NULL &&
> >  	    rcp->donetail != rcp->curtail) {
> >  		rcp->donetail = rcp->curtail;
> > @@ -251,7 +251,7 @@ void rcu_bh_qs(int cpu)
> >   */
> >  void rcu_check_callbacks(int cpu, int user)
> >  {
> > -	check_cpu_stalls();
> > +	RCU_TRACE(check_cpu_stalls());
> >  	if (user || rcu_is_cpu_rrupt_from_idle())
> >  		rcu_sched_qs(cpu);
> >  	else if (!in_softirq())
> > diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
> > index 65ef180..0cd385a 100644
> > --- a/kernel/rcutiny_plugin.h
> > +++ b/kernel/rcutiny_plugin.h
> > @@ -158,15 +158,11 @@ static void check_cpu_stall(struct rcu_ctrlblk *rcp)
> >  		rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> >  }
> >  
> > -#endif /* #ifdef CONFIG_RCU_TRACE */
> > -
> >  static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
> >  {
> > -#ifdef CONFIG_RCU_TRACE
> >  	rcp->ticks_this_gp = 0;
> >  	rcp->gp_start = jiffies;
> >  	rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
> > -#endif /* #ifdef CONFIG_RCU_TRACE */
> >  }
> >  
> >  static void check_cpu_stalls(void)
> > @@ -174,3 +170,5 @@ static void check_cpu_stalls(void)
> >  	RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
> >  	RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
> >  }
> > +
> > +#endif /* #ifdef CONFIG_RCU_TRACE */
> > -- 
> > 1.8.1.5
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


  reply	other threads:[~2013-05-21 21:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-20 14:57 [PATCH tip/core/rcu 0/13] v2 TINY_RCU changes for 3.11 Paul E. McKenney
2013-05-20 14:58 ` [PATCH tip/core/rcu 01/13] rcu: Remove TINY_PREEMPT_RCU Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 02/13] rcu: Remove show_tiny_preempt_stats() Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 03/13] rcu: Remove rcu_preempt_check_callbacks() Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 04/13] rcu: Remove rcu_preempt_remove_callbacks() Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 05/13] rcu: Remove rcu_preempt_process_callbacks() Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 06/13] rcu: Simplify RCU_TINY RCU callback invocation Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 07/13] rcu: Remove check_cpu_stall_preempt() Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 08/13] rcu: Remove the CONFIG_TINY_RCU ifdefs in rcutiny.h Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 09/13] rcu: Remove rcu_preempt_note_context_switch() Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 10/13] rcu: Consolidate rcutiny_plugin.h ifdefs Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 11/13] rcu: Remove TINY_PREEMPT_RCU tracing documentation Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 12/13] rcu: Shrink TINY_RCU by moving exit_rcu() Paul E. McKenney
2013-05-20 14:58   ` [PATCH tip/core/rcu 13/13] rcu: Shrink TINY_RCU by reworking CPU-stall ifdefs Paul E. McKenney
2013-05-21 17:31     ` Josh Triplett
2013-05-21 21:09       ` Paul E. McKenney [this message]
2013-05-21 21:48         ` Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130521210957.GV3578@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=darren@dvhart.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sbw@mit.edu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox