Commit c8aead6a authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Simplify sync_rcu_preempt_exp_init()

This commit eliminates a boolean and associated "if" statement by
rearranging the code.
Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
parent 78043c46
...@@ -677,19 +677,16 @@ static void ...@@ -677,19 +677,16 @@ static void
sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp) sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp)
{ {
unsigned long flags; unsigned long flags;
int must_wait = 0;
raw_spin_lock_irqsave(&rnp->lock, flags); raw_spin_lock_irqsave(&rnp->lock, flags);
smp_mb__after_unlock_lock(); smp_mb__after_unlock_lock();
if (!rcu_preempt_has_tasks(rnp)) { if (!rcu_preempt_has_tasks(rnp)) {
raw_spin_unlock_irqrestore(&rnp->lock, flags); raw_spin_unlock_irqrestore(&rnp->lock, flags);
rcu_report_exp_rnp(rsp, rnp, false); /* No tasks, report. */
} else { } else {
rnp->exp_tasks = rnp->blkd_tasks.next; rnp->exp_tasks = rnp->blkd_tasks.next;
rcu_initiate_boost(rnp, flags); /* releases rnp->lock */ rcu_initiate_boost(rnp, flags); /* releases rnp->lock */
must_wait = 1;
} }
if (!must_wait)
rcu_report_exp_rnp(rsp, rnp, false); /* Don't wake self. */
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment