Merge tag 'x86-timers-2020-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / kernel / rcu / rcutorture.c
index 2621a33..d0d2653 100644 (file)
@@ -7,7 +7,7 @@
  * Authors: Paul E. McKenney <paulmck@linux.ibm.com>
  *       Josh Triplett <josh@joshtriplett.org>
  *
- * See also:  Documentation/RCU/torture.txt
+ * See also:  Documentation/RCU/torture.rst
  */
 
 #define pr_fmt(fmt) fmt
@@ -1172,6 +1172,7 @@ rcu_torture_writer(void *arg)
                                        WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rcu_tortures[i].rtort_pipe_count);
                                }
        } while (!torture_must_stop());
+       rcu_torture_current = NULL;  // Let stats task know that we are done.
        /* Reset expediting back to unexpedited. */
        if (expediting > 0)
                expediting = -expediting;
@@ -1376,6 +1377,7 @@ static bool rcu_torture_one_read(struct torture_random_state *trsp)
        struct rt_read_seg *rtrsp1;
        unsigned long long ts;
 
+       WARN_ON_ONCE(!rcu_is_watching());
        newstate = rcutorture_extend_mask(readstate, trsp);
        rcutorture_one_extend(&readstate, newstate, trsp, rtrsp++);
        started = cur_ops->get_gp_seq();
@@ -2184,7 +2186,7 @@ static void rcu_torture_barrier1cb(void *rcu_void)
 static int rcu_torture_barrier_cbs(void *arg)
 {
        long myid = (long)arg;
-       bool lastphase = 0;
+       bool lastphase = false;
        bool newphase;
        struct rcu_head rcu;
 
@@ -2473,7 +2475,6 @@ rcu_torture_cleanup(void)
                                             reader_tasks[i]);
                kfree(reader_tasks);
        }
-       rcu_torture_current = NULL;
 
        if (fakewriter_tasks) {
                for (i = 0; i < nfakewriters; i++) {