aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.ibm.com>2018-10-01 16:27:41 -0400
committerPaul E. McKenney <paulmck@linux.ibm.com>2018-12-01 15:45:35 -0500
commit61670adcb4a9f66ff3fa8a9e846a623d9a9e1553 (patch)
treecd50d7521cfbafd513e34d5779b8e1d763f0ac70
parent2a7d968816a94a4c52f0082c085c6714a5b3f1ec (diff)
rcutorture: Prepare for asynchronous access to rcu_fwd_startat
Because rcutorture's forward-progress checking will trigger from an OOM notifier, this notifier will introduce asynchronous concurrent access to the rcu_fwd_startat variable. This commit therefore prepares for this by converting updates to WRITE_ONCE(). Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
-rw-r--r--kernel/rcu/rcutorture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 36a3bc42782d..c4fd61dccedb 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -1679,7 +1679,7 @@ static void rcu_torture_fwd_prog_nr(int *tested, int *tested_tries)
1679 sd = cur_ops->stall_dur() + 1; 1679 sd = cur_ops->stall_dur() + 1;
1680 sd4 = (sd + fwd_progress_div - 1) / fwd_progress_div; 1680 sd4 = (sd + fwd_progress_div - 1) / fwd_progress_div;
1681 dur = sd4 + torture_random(&trs) % (sd - sd4); 1681 dur = sd4 + torture_random(&trs) % (sd - sd4);
1682 rcu_fwd_startat = jiffies; 1682 WRITE_ONCE(rcu_fwd_startat, jiffies);
1683 stopat = rcu_fwd_startat + dur; 1683 stopat = rcu_fwd_startat + dur;
1684 while (time_before(jiffies, stopat) && !torture_must_stop()) { 1684 while (time_before(jiffies, stopat) && !torture_must_stop()) {
1685 idx = cur_ops->readlock(); 1685 idx = cur_ops->readlock();
@@ -1728,7 +1728,7 @@ static void rcu_torture_fwd_prog_cr(void)
1728 /* Loop continuously posting RCU callbacks. */ 1728 /* Loop continuously posting RCU callbacks. */
1729 WRITE_ONCE(rcu_fwd_cb_nodelay, true); 1729 WRITE_ONCE(rcu_fwd_cb_nodelay, true);
1730 cur_ops->sync(); /* Later readers see above write. */ 1730 cur_ops->sync(); /* Later readers see above write. */
1731 rcu_fwd_startat = jiffies; 1731 WRITE_ONCE(rcu_fwd_startat, jiffies);
1732 stopat = rcu_fwd_startat + MAX_FWD_CB_JIFFIES; 1732 stopat = rcu_fwd_startat + MAX_FWD_CB_JIFFIES;
1733 n_launders = 0; 1733 n_launders = 0;
1734 n_launders_cb = 0; 1734 n_launders_cb = 0;