]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rcutorture: Check GP completion at stutter end
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 7 Aug 2018 21:34:44 +0000 (14:34 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 29 Aug 2018 16:20:48 +0000 (09:20 -0700)
The rcu_torture_writer() function invokes stutter_wait() at the end of
each writer pass, which occasionally blocks for an extended time period
in order to ensure that RCU can handle intermittent loads.  But part of
handling a busy period is invoking all the callbacks before the end of
the idle period induced by stutter_wait().

This commit therefore adds a return value to stutter_wait() indicating
whether stutter_wait() actually waited.  In addition, this commit causes
rcu_torture_writer() to test this value and if set, checks that all the
elements of the rcu_tortures[] array have been freed up.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/torture.h
kernel/rcu/rcutorture.c
kernel/torture.c

index 61dfd93b6ee4d6f47f2609319e01c6192620b3fb..48fad21109fc9df9ecd20d4e9fcbb757fed1ccb7 100644 (file)
@@ -77,7 +77,7 @@ void torture_shutdown_absorb(const char *title);
 int torture_shutdown_init(int ssecs, void (*cleanup)(void));
 
 /* Task stuttering, which forces load/no-load transitions. */
-void stutter_wait(const char *title);
+bool stutter_wait(const char *title);
 int torture_stutter_init(int s);
 
 /* Initialization and cleanup. */
index 7df8142a6a22cdccfb79c86764f84b78721f6897..ae10ad531993545e81bd0b1fc4ab4d9c97d2f65c 100644 (file)
@@ -1144,7 +1144,10 @@ rcu_torture_writer(void *arg)
                                       !rcu_gp_is_normal();
                }
                rcu_torture_writer_state = RTWS_STUTTER;
-               stutter_wait("rcu_torture_writer");
+               if (stutter_wait("rcu_torture_writer"))
+                       for (i = 0; i < ARRAY_SIZE(rcu_tortures); i++)
+                               if (list_empty(&rcu_tortures[i].rtort_free))
+                                       WARN_ON_ONCE(1);
        } while (!torture_must_stop());
        /* Reset expediting back to unexpedited. */
        if (expediting > 0)
index 1ac24a826589353396f02c98150049d134e6e7dd..17d91f5fba2acb09da97fe4cacb6479d52cb0bdd 100644 (file)
@@ -573,7 +573,7 @@ static int stutter;
  * Block until the stutter interval ends.  This must be called periodically
  * by all running kthreads that need to be subject to stuttering.
  */
-void stutter_wait(const char *title)
+bool stutter_wait(const char *title)
 {
        int spt;
 
@@ -590,6 +590,7 @@ void stutter_wait(const char *title)
                }
                torture_shutdown_absorb(title);
        }
+       return !!spt;
 }
 EXPORT_SYMBOL_GPL(stutter_wait);