[PATCH] Fix bug in RCU torture test
authorSrivatsa Vaddagiri <vatsa@in.ibm.com>
Mon, 12 Dec 2005 08:37:06 +0000 (00:37 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 12 Dec 2005 16:57:42 +0000 (08:57 -0800)
While doing some test of RCU torture module, I hit a OOPS in rcu_do_batch,
which was trying to processes callback of a module that was just removed.
This is because we weren't waiting long enough for all callbacks to fire.

Signed-off-by: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Acked-by: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/rcutorture.c

index 88c28d4..49fbbef 100644 (file)
@@ -409,9 +409,8 @@ rcu_torture_cleanup(void)
        stats_task = NULL;
 
        /* Wait for all RCU callbacks to fire.  */
+       rcu_barrier();
 
-       for (i = 0; i < RCU_TORTURE_PIPE_LEN; i++)
-               synchronize_rcu();
        rcu_torture_stats_print();  /* -After- the stats thread is stopped! */
        printk(KERN_ALERT TORTURE_FLAG
               "--- End of test: %s\n",