From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
jiangshanlai@gmail.com, dipankar@in.ibm.com,
akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
"Paul E. McKenney" <paulmck@linux.ibm.com>
Subject: [PATCH tip/core/rcu 16/18] rcu: Eliminate redundant NULL-pointer check
Date: Tue, 26 Mar 2019 16:13:12 -0700 [thread overview]
Message-ID: <20190326231314.19518-16-paulmck@linux.ibm.com> (raw)
In-Reply-To: <20190326231253.GA18343@linux.ibm.com>
Because rcu_wake_cond() checks for a null task_struct pointer, there is
no need for its callers to do so. This commit eliminates the redundant
check.
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
kernel/rcu/tree_plugin.h | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index f0aeb7416dcc..81d3cd821891 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1191,8 +1191,6 @@ static int rcu_boost_kthread(void *arg)
static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags)
__releases(rnp->lock)
{
- struct task_struct *t;
-
raw_lockdep_assert_held_rcu_node(rnp);
if (!rcu_preempt_blocked_readers_cgp(rnp) && rnp->exp_tasks == NULL) {
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
@@ -1206,9 +1204,8 @@ static void rcu_initiate_boost(struct rcu_node *rnp, unsigned long flags)
if (rnp->exp_tasks == NULL)
rnp->boost_tasks = rnp->gp_tasks;
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
- t = rnp->boost_kthread_task;
- if (t)
- rcu_wake_cond(t, rnp->boost_kthread_status);
+ rcu_wake_cond(rnp->boost_kthread_task,
+ rnp->boost_kthread_status);
} else {
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
}
--
2.17.1
next prev parent reply other threads:[~2019-03-26 23:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-26 23:12 [PATCH tip/core/rcu 0/18] Miscellaneous fixes for v5.2 Paul E. McKenney
2019-03-26 23:12 ` [PATCH tip/core/rcu 01/18] rcu: Unconditionally expedite during suspend/hibernate Paul E. McKenney
2019-03-26 23:12 ` [PATCH tip/core/rcu 02/18] rcu: Avoid unnecessary softirq when system is idle Paul E. McKenney
2019-03-26 23:12 ` [PATCH tip/core/rcu 03/18] rcu: rcu_qs -- Use raise_softirq_irqoff to not save irqs twice Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 04/18] rcu: Make exit_rcu() handle non-preempted RCU readers Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 05/18] rcu: Set rcutree.kthread_prio sysfs access to read-only Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 06/18] MAINTAINERS: RCU now has its own email list Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 07/18] MAINTAINERS: Add -rcu branch name ("dev") Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 08/18] rcu: Move common code out of if-else block Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 09/18] rcu: Allow rcu_nocbs= to specify all CPUs Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 10/18] rcu: Report error for bad rcu_nocbs= parameter values Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 11/18] rcu: Fix self-wakeups for grace-period kthread Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 12/18] rcu: Default jiffies_to_sched_qs to jiffies_till_sched_qs Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 13/18] rcu: Do a single rhp->func read in rcu_head_after_call_rcu() Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 14/18] rcu: Update jiffies_to_sched_qs and adjust_jiffies_till_sched_qs() comments Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 15/18] rcu: Fix force_qs_rnp() header comment Paul E. McKenney
2019-03-26 23:13 ` Paul E. McKenney [this message]
2019-03-26 23:13 ` [PATCH tip/core/rcu 17/18] rcu: Fix typo in tree_exp.h comment Paul E. McKenney
2019-03-26 23:13 ` [PATCH tip/core/rcu 18/18] rcu: Correct READ_ONCE()/WRITE_ONCE() for ->rcu_read_unlock_special 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=20190326231314.19518-16-paulmck@linux.ibm.com \
--to=paulmck@linux.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=edumazet@google.com \
--cc=fweisbec@gmail.com \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
--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;
as well as URLs for NNTP newsgroup(s).