struct rcu_torture *rp;
        struct rcu_torture *old_rp;
        static DEFINE_TORTURE_RANDOM(rand);
+       unsigned long stallsdone = jiffies;
        bool stutter_waited;
        unsigned long ulo[NUM_ACTIVE_RCU_POLL_OLDSTATE];
 
+       // If a new stall test is added, this must be adjusted.
+       if (stall_cpu_holdoff + stall_gp_kthread + stall_cpu)
+               stallsdone += (stall_cpu_holdoff + stall_gp_kthread + stall_cpu + 60) * HZ;
        VERBOSE_TOROUT_STRING("rcu_torture_writer task started");
        if (!can_expedite)
                pr_alert("%s" TORTURE_FLAG
                    !atomic_read(&rcu_fwd_cb_nodelay) &&
                    !cur_ops->slow_gps &&
                    !torture_must_stop() &&
-                   boot_ended)
+                   boot_ended &&
+                   time_after(jiffies, stallsdone))
                        for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++)
                                if (list_empty(&rcu_tortures[i].rtort_free) &&
-                                   rcu_access_pointer(rcu_torture_current) !=
-                                   &rcu_tortures[i]) {
+                                   rcu_access_pointer(rcu_torture_current) != &rcu_tortures[i]) {
                                        tracing_off();
                                        show_rcu_gp_kthreads();
                                        WARN(1, "%s: rtort_pipe_count: %d\n", __func__, rcu_tortures[i].rtort_pipe_count);
 
 /*
  * CPU-stall kthread.  It waits as specified by stall_cpu_holdoff, then
- * induces a CPU stall for the time specified by stall_cpu.
+ * induces a CPU stall for the time specified by stall_cpu.  If a new
+ * stall test is added, stallsdone in rcu_torture_writer() must be adjusted.
  */
 static int rcu_torture_stall(void *args)
 {