rcutorture: Manually clean up after rcu_barrier() failure
authorPaul E. McKenney <paulmck@kernel.org>
Wed, 5 Feb 2020 20:54:34 +0000 (12:54 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Fri, 21 Feb 2020 00:03:31 +0000 (16:03 -0800)
commit9470a18fabd056e67ee12059dab04faf6e1f253c
tree6a3163c94456ef850cf9fe783f8acc16bc252759
parent50d4b62970e21e9573daf0e3c1138b4d1ebcca47
rcutorture: Manually clean up after rcu_barrier() failure

Currently, if rcu_barrier() returns too soon, the test waits 100ms and
then does another instance of the test.  However, if rcu_barrier() were
to have waited for more than 100ms too short a time, this could cause
the test's rcu_head structures to be reused while they were still on
RCU's callback lists.  This can result in knock-on errors that obscure
the original rcu_barrier() test failure.

This commit therefore adds code that attempts to wait until all of
the test's callbacks have been invoked.  Of course, if RCU completely
lost track of the corresponding rcu_head structures, this wait could be
forever.  This commit therefore also complains if this attempted recovery
takes more than one second, and it also gives up when the test ends.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/rcutorture.c