From: Josh Triplett <josh@joshtriplett.org>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
laijs@cn.fujitsu.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org,
rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
darren@dvhart.com, fweisbec@gmail.com, oleg@redhat.com,
sbw@mit.edu
Subject: Re: [PATCH tip/core/rcu 3/3] rcu: Optimize RCU_FAST_NO_HZ for RCU_NOCB_CPU_ALL
Date: Mon, 17 Feb 2014 13:54:43 -0800 [thread overview]
Message-ID: <20140217215443.GG7941@thin> (raw)
In-Reply-To: <1392673227-7066-3-git-send-email-paulmck@linux.vnet.ibm.com>
On Mon, Feb 17, 2014 at 01:40:27PM -0800, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
>
> If CONFIG_RCU_NOCB_CPU_ALL=y, then no CPU will ever have RCU callbacks
> because these callbacks will instead be handled by the rcuo kthreads.
> However, the current version of RCU_FAST_NO_HZ nevertheless checks for RCU
> callbacks. This commit therefore creates static inline implementations
> of rcu_prepare_for_idle() and rcu_cleanup_after_idle() that are no-ops
> when CONFIG_RCU_NOCB_CPU_ALL=y.
"creates static inline implementations" isn't quite accurate; they're
static, and in the header, and the compiler is likely to inline the
no-op versions, but they're not actually marked as inline. The commit
message should just say that it turns the implementations into no-ops.
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
> kernel/rcu/tree_plugin.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index 820b06aefbee..41afc3fbfb6c 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -1658,7 +1658,7 @@ extern int tick_nohz_active;
> * only if it has been awhile since the last time we did so. Afterwards,
> * if there are any callbacks ready for immediate invocation, return true.
> */
> -static bool rcu_try_advance_all_cbs(void)
> +static bool __maybe_unused rcu_try_advance_all_cbs(void)
> {
> bool cbs_ready = false;
> struct rcu_data *rdp;
> @@ -1743,6 +1743,7 @@ int rcu_needs_cpu(int cpu, unsigned long *dj)
> */
> static void rcu_prepare_for_idle(int cpu)
> {
> +#ifndef CONFIG_RCU_NOCB_CPU_ALL
> struct rcu_data *rdp;
> struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu);
> struct rcu_node *rnp;
> @@ -1794,6 +1795,7 @@ static void rcu_prepare_for_idle(int cpu)
> rcu_accelerate_cbs(rsp, rnp, rdp);
> raw_spin_unlock(&rnp->lock); /* irqs remain disabled. */
> }
> +#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
> }
>
> /*
> @@ -1803,11 +1805,12 @@ static void rcu_prepare_for_idle(int cpu)
> */
> static void rcu_cleanup_after_idle(int cpu)
> {
> -
> +#ifndef CONFIG_RCU_NOCB_CPU_ALL
> if (rcu_is_nocb_cpu(cpu))
> return;
> if (rcu_try_advance_all_cbs())
> invoke_rcu_core();
> +#endif /* #ifndef CONFIG_RCU_NOCB_CPU_ALL */
> }
>
> /*
> --
> 1.8.1.5
>
next prev parent reply other threads:[~2014-02-17 21:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-17 21:40 [PATCH tip/core/rcu 0/3] Response-time changes for 3.15 Paul E. McKenney
2014-02-17 21:40 ` [PATCH tip/core/rcu 1/3] rcu: Optimize rcu_is_nocb_cpu() for RCU_NOCB_CPU_ALL Paul E. McKenney
2014-02-17 21:40 ` [PATCH tip/core/rcu 2/3] rcu: Optimize rcu_needs_cpu() " Paul E. McKenney
2014-02-17 21:53 ` Josh Triplett
2014-02-17 21:40 ` [PATCH tip/core/rcu 3/3] rcu: Optimize RCU_FAST_NO_HZ " Paul E. McKenney
2014-02-17 21:54 ` Josh Triplett [this message]
2014-02-17 21:50 ` [PATCH tip/core/rcu 1/3] rcu: Optimize rcu_is_nocb_cpu() " Josh Triplett
2014-02-17 23:33 ` Paul E. McKenney
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=20140217215443.GG7941@thin \
--to=josh@joshtriplett.org \
--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=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=niv@us.ibm.com \
--cc=oleg@redhat.com \
--cc=paulmck@linux.vnet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.