aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2013-12-04 21:42:03 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-17 18:01:42 -0500
commitcb1e78cfa267453bb19e7edafd214c03834b664c (patch)
tree1211ed872c631b1cd71052cbd20e0ca89221cb51 /kernel/rcu
parent87de1cfdc55b16b794e245b07322340725149d62 (diff)
rcu: Remove ACCESS_ONCE() from jiffies
Because jiffies is one of a very few variables marked "volatile", there is no need to use ACCESS_ONCE() when accessing it. This commit therefore removes the redundant ACCESS_ONCE() wrappers. Reported by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/torture.c4
-rw-r--r--kernel/rcu/tree.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/kernel/rcu/torture.c b/kernel/rcu/torture.c
index ab7dd192a50b..022c5312b725 100644
--- a/kernel/rcu/torture.c
+++ b/kernel/rcu/torture.c
@@ -1352,7 +1352,7 @@ rcu_torture_shutdown(void *arg)
1352 unsigned long jiffies_snap; 1352 unsigned long jiffies_snap;
1353 1353
1354 VERBOSE_PRINTK_STRING("rcu_torture_shutdown task started"); 1354 VERBOSE_PRINTK_STRING("rcu_torture_shutdown task started");
1355 jiffies_snap = ACCESS_ONCE(jiffies); 1355 jiffies_snap = jiffies;
1356 while (ULONG_CMP_LT(jiffies_snap, shutdown_time) && 1356 while (ULONG_CMP_LT(jiffies_snap, shutdown_time) &&
1357 !kthread_should_stop()) { 1357 !kthread_should_stop()) {
1358 delta = shutdown_time - jiffies_snap; 1358 delta = shutdown_time - jiffies_snap;
@@ -1361,7 +1361,7 @@ rcu_torture_shutdown(void *arg)
1361 "rcu_torture_shutdown task: %lu jiffies remaining\n", 1361 "rcu_torture_shutdown task: %lu jiffies remaining\n",
1362 torture_type, delta); 1362 torture_type, delta);
1363 schedule_timeout_interruptible(delta); 1363 schedule_timeout_interruptible(delta);
1364 jiffies_snap = ACCESS_ONCE(jiffies); 1364 jiffies_snap = jiffies;
1365 } 1365 }
1366 if (kthread_should_stop()) { 1366 if (kthread_should_stop()) {
1367 VERBOSE_PRINTK_STRING("rcu_torture_shutdown task stopping"); 1367 VERBOSE_PRINTK_STRING("rcu_torture_shutdown task stopping");
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 321feef0f5c0..73c3cd2b87ac 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -837,7 +837,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
837 * to the next. Only do this for the primary flavor of RCU. 837 * to the next. Only do this for the primary flavor of RCU.
838 */ 838 */
839 if (rdp->rsp == rcu_state && 839 if (rdp->rsp == rcu_state &&
840 ULONG_CMP_GE(ACCESS_ONCE(jiffies), rdp->rsp->jiffies_resched)) { 840 ULONG_CMP_GE(jiffies, rdp->rsp->jiffies_resched)) {
841 rdp->rsp->jiffies_resched += 5; 841 rdp->rsp->jiffies_resched += 5;
842 resched_cpu(rdp->cpu); 842 resched_cpu(rdp->cpu);
843 } 843 }
@@ -847,7 +847,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp,
847 847
848static void record_gp_stall_check_time(struct rcu_state *rsp) 848static void record_gp_stall_check_time(struct rcu_state *rsp)
849{ 849{
850 unsigned long j = ACCESS_ONCE(jiffies); 850 unsigned long j = jiffies;
851 unsigned long j1; 851 unsigned long j1;
852 852
853 rsp->gp_start = j; 853 rsp->gp_start = j;
@@ -1005,7 +1005,7 @@ static void check_cpu_stall(struct rcu_state *rsp, struct rcu_data *rdp)
1005 1005
1006 if (rcu_cpu_stall_suppress || !rcu_gp_in_progress(rsp)) 1006 if (rcu_cpu_stall_suppress || !rcu_gp_in_progress(rsp))
1007 return; 1007 return;
1008 j = ACCESS_ONCE(jiffies); 1008 j = jiffies;
1009 1009
1010 /* 1010 /*
1011 * Lots of memory barriers to reject false positives. 1011 * Lots of memory barriers to reject false positives.