diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-01-19 19:56:46 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2015-03-11 16:22:37 -0400 |
commit | c8aead6a9b27fdd94b7bcb74b587ae012d8145f2 (patch) | |
tree | 89a8e040da6e361ab2fef199d78a3fd1a894bfed /kernel | |
parent | 78043c467a91573cc1d51827fe10d7d15ae79a60 (diff) |
rcu: Simplify sync_rcu_preempt_exp_init()
This commit eliminates a boolean and associated "if" statement by
rearranging the code.
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/rcu/tree_plugin.h | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index 0a571e9a0f1d..d37c9fbdba71 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h | |||
@@ -677,19 +677,16 @@ static void | |||
677 | sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp) | 677 | sync_rcu_preempt_exp_init(struct rcu_state *rsp, struct rcu_node *rnp) |
678 | { | 678 | { |
679 | unsigned long flags; | 679 | unsigned long flags; |
680 | int must_wait = 0; | ||
681 | 680 | ||
682 | raw_spin_lock_irqsave(&rnp->lock, flags); | 681 | raw_spin_lock_irqsave(&rnp->lock, flags); |
683 | smp_mb__after_unlock_lock(); | 682 | smp_mb__after_unlock_lock(); |
684 | if (!rcu_preempt_has_tasks(rnp)) { | 683 | if (!rcu_preempt_has_tasks(rnp)) { |
685 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | 684 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
685 | rcu_report_exp_rnp(rsp, rnp, false); /* No tasks, report. */ | ||
686 | } else { | 686 | } else { |
687 | rnp->exp_tasks = rnp->blkd_tasks.next; | 687 | rnp->exp_tasks = rnp->blkd_tasks.next; |
688 | rcu_initiate_boost(rnp, flags); /* releases rnp->lock */ | 688 | rcu_initiate_boost(rnp, flags); /* releases rnp->lock */ |
689 | must_wait = 1; | ||
690 | } | 689 | } |
691 | if (!must_wait) | ||
692 | rcu_report_exp_rnp(rsp, rnp, false); /* Don't wake self. */ | ||
693 | } | 690 | } |
694 | 691 | ||
695 | /** | 692 | /** |