aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPranith Kumar <bobby.prani@gmail.com>2014-07-08 17:46:50 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-09-07 19:18:07 -0400
commit4de376a1b14e32f550931274f06b571abc0f3d4b (patch)
tree2641f4598c5580d05652593f8c6bd4f601b94f4a /kernel/rcu
parent11ed7f934cb807f26da09547b5946c2e534d1dac (diff)
rcu: Remove remaining read-modify-write ACCESS_ONCE() calls
Change the remaining uses of ACCESS_ONCE() so that each ACCESS_ONCE() either does a load or a store, but not both. Signed-off-by: Pranith Kumar <bobby.prani@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree.c6
-rw-r--r--kernel/rcu/tree_plugin.h8
2 files changed, 9 insertions, 5 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 1b70cb6fbe3c..4b526ca46801 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1684,7 +1684,8 @@ static int rcu_gp_fqs(struct rcu_state *rsp, int fqs_state_in)
1684 if (ACCESS_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) { 1684 if (ACCESS_ONCE(rsp->gp_flags) & RCU_GP_FLAG_FQS) {
1685 raw_spin_lock_irq(&rnp->lock); 1685 raw_spin_lock_irq(&rnp->lock);
1686 smp_mb__after_unlock_lock(); 1686 smp_mb__after_unlock_lock();
1687 ACCESS_ONCE(rsp->gp_flags) &= ~RCU_GP_FLAG_FQS; 1687 ACCESS_ONCE(rsp->gp_flags) =
1688 ACCESS_ONCE(rsp->gp_flags) & ~RCU_GP_FLAG_FQS;
1688 raw_spin_unlock_irq(&rnp->lock); 1689 raw_spin_unlock_irq(&rnp->lock);
1689 } 1690 }
1690 return fqs_state; 1691 return fqs_state;
@@ -2505,7 +2506,8 @@ static void force_quiescent_state(struct rcu_state *rsp)
2505 raw_spin_unlock_irqrestore(&rnp_old->lock, flags); 2506 raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
2506 return; /* Someone beat us to it. */ 2507 return; /* Someone beat us to it. */
2507 } 2508 }
2508 ACCESS_ONCE(rsp->gp_flags) |= RCU_GP_FLAG_FQS; 2509 ACCESS_ONCE(rsp->gp_flags) =
2510 ACCESS_ONCE(rsp->gp_flags) | RCU_GP_FLAG_FQS;
2509 raw_spin_unlock_irqrestore(&rnp_old->lock, flags); 2511 raw_spin_unlock_irqrestore(&rnp_old->lock, flags);
2510 wake_up(&rsp->gp_wq); /* Memory barrier implied by wake_up() path. */ 2512 wake_up(&rsp->gp_wq); /* Memory barrier implied by wake_up() path. */
2511} 2513}
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index a7997e272564..218fae30c380 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -897,7 +897,8 @@ void synchronize_rcu_expedited(void)
897 897
898 /* Clean up and exit. */ 898 /* Clean up and exit. */
899 smp_mb(); /* ensure expedited GP seen before counter increment. */ 899 smp_mb(); /* ensure expedited GP seen before counter increment. */
900 ACCESS_ONCE(sync_rcu_preempt_exp_count)++; 900 ACCESS_ONCE(sync_rcu_preempt_exp_count) =
901 sync_rcu_preempt_exp_count + 1;
901unlock_mb_ret: 902unlock_mb_ret:
902 mutex_unlock(&sync_rcu_preempt_exp_mutex); 903 mutex_unlock(&sync_rcu_preempt_exp_mutex);
903mb_ret: 904mb_ret:
@@ -2428,8 +2429,9 @@ static int rcu_nocb_kthread(void *arg)
2428 list = next; 2429 list = next;
2429 } 2430 }
2430 trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1); 2431 trace_rcu_batch_end(rdp->rsp->name, c, !!list, 0, 0, 1);
2431 ACCESS_ONCE(rdp->nocb_p_count) -= c; 2432 ACCESS_ONCE(rdp->nocb_p_count) = rdp->nocb_p_count - c;
2432 ACCESS_ONCE(rdp->nocb_p_count_lazy) -= cl; 2433 ACCESS_ONCE(rdp->nocb_p_count_lazy) =
2434 rdp->nocb_p_count_lazy - cl;
2433 rdp->n_nocbs_invoked += c; 2435 rdp->n_nocbs_invoked += c;
2434 } 2436 }
2435 return 0; 2437 return 0;