aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/torture.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rcu/torture.c')
-rw-r--r--kernel/rcu/torture.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/rcu/torture.c b/kernel/rcu/torture.c
index 3929cd451511..69a4ec80a788 100644
--- a/kernel/rcu/torture.c
+++ b/kernel/rcu/torture.c
@@ -1578,6 +1578,7 @@ static int rcu_torture_barrier_cbs(void *arg)
1578{ 1578{
1579 long myid = (long)arg; 1579 long myid = (long)arg;
1580 bool lastphase = 0; 1580 bool lastphase = 0;
1581 bool newphase;
1581 struct rcu_head rcu; 1582 struct rcu_head rcu;
1582 1583
1583 init_rcu_head_on_stack(&rcu); 1584 init_rcu_head_on_stack(&rcu);
@@ -1585,10 +1586,11 @@ static int rcu_torture_barrier_cbs(void *arg)
1585 set_user_nice(current, 19); 1586 set_user_nice(current, 19);
1586 do { 1587 do {
1587 wait_event(barrier_cbs_wq[myid], 1588 wait_event(barrier_cbs_wq[myid],
1588 barrier_phase != lastphase || 1589 (newphase =
1590 ACCESS_ONCE(barrier_phase)) != lastphase ||
1589 kthread_should_stop() || 1591 kthread_should_stop() ||
1590 fullstop != FULLSTOP_DONTSTOP); 1592 fullstop != FULLSTOP_DONTSTOP);
1591 lastphase = barrier_phase; 1593 lastphase = newphase;
1592 smp_mb(); /* ensure barrier_phase load before ->call(). */ 1594 smp_mb(); /* ensure barrier_phase load before ->call(). */
1593 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP) 1595 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP)
1594 break; 1596 break;
@@ -1625,7 +1627,7 @@ static int rcu_torture_barrier(void *arg)
1625 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP) 1627 if (kthread_should_stop() || fullstop != FULLSTOP_DONTSTOP)
1626 break; 1628 break;
1627 n_barrier_attempts++; 1629 n_barrier_attempts++;
1628 cur_ops->cb_barrier(); 1630 cur_ops->cb_barrier(); /* Implies smp_mb() for wait_event(). */
1629 if (atomic_read(&barrier_cbs_invoked) != n_barrier_cbs) { 1631 if (atomic_read(&barrier_cbs_invoked) != n_barrier_cbs) {
1630 n_rcu_torture_barrier_error++; 1632 n_rcu_torture_barrier_error++;
1631 WARN_ON_ONCE(1); 1633 WARN_ON_ONCE(1);