From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Pranith Kumar <bobby.prani@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>,
Steven Rostedt <rostedt@goodmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Lai Jiangshan <laijs@cn.fujitsu.com>,
"open list:READ-COPY UPDATE..." <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] rcu: Remove redundant checks for rcu_scheduler_fully_active
Date: Thu, 17 Jul 2014 16:40:27 -0700 [thread overview]
Message-ID: <20140717234027.GC8690@linux.vnet.ibm.com> (raw)
In-Reply-To: <1405475402-7181-1-git-send-email-bobby.prani@gmail.com>
On Tue, Jul 15, 2014 at 09:50:02PM -0400, Pranith Kumar wrote:
> rcu_scheduler_fully_active is set to true early in the boot process.
>
> rcu_prepare_kthreads() is called in two locations. Once after setting the above
> flag and the other while hotplugging a CPU from rcu_cpu_notify(). CPU hotplug is
> enabled much later by which time the above flag is already set. Hence checking
> for this flag is redundant in this function.
>
> The checks in rcu_spawn_one_boost_kthread() and rcu_spawn_all_nocb_kthreads()
> are similarly redundant.
>
> This commit removes the redundant checks for this flag from the above
> locations.
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Good catch! Queued for 3.18.
Thanx, Paul
> ---
> kernel/rcu/tree_plugin.h | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
> index 17ccb62..a2113f6 100644
> --- a/kernel/rcu/tree_plugin.h
> +++ b/kernel/rcu/tree_plugin.h
> @@ -1341,7 +1341,7 @@ static int rcu_spawn_one_boost_kthread(struct rcu_state *rsp,
> if (&rcu_preempt_state != rsp)
> return 0;
>
> - if (!rcu_scheduler_fully_active || rnp->qsmaskinit == 0)
> + if (rnp->qsmaskinit == 0)
> return 0;
>
> rsp->boost = 1;
> @@ -1489,8 +1489,7 @@ static void rcu_prepare_kthreads(int cpu)
> struct rcu_node *rnp = rdp->mynode;
>
> /* Fire up the incoming CPU's kthread and leaf rcu_node kthread. */
> - if (rcu_scheduler_fully_active)
> - (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
> + (void)rcu_spawn_one_boost_kthread(rcu_state_p, rnp);
> }
>
> #else /* #ifdef CONFIG_RCU_BOOST */
> @@ -2509,9 +2508,8 @@ static void rcu_spawn_all_nocb_kthreads(int cpu)
> {
> struct rcu_state *rsp;
>
> - if (rcu_scheduler_fully_active)
> - for_each_rcu_flavor(rsp)
> - rcu_spawn_one_nocb_kthread(rsp, cpu);
> + for_each_rcu_flavor(rsp)
> + rcu_spawn_one_nocb_kthread(rsp, cpu);
> }
>
> /*
> --
> 1.9.1
>
prev parent reply other threads:[~2014-07-17 23:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-16 1:50 [PATCH 1/1] rcu: Remove redundant checks for rcu_scheduler_fully_active Pranith Kumar
2014-07-17 23:40 ` Paul E. McKenney [this message]
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=20140717234027.GC8690@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=bobby.prani@gmail.com \
--cc=josh@joshtriplett.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=rostedt@goodmis.org \
/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.