rcutorture: Abstract torture-test cleanup

This commit creates a torture_cleanup() that handles the generic
cleanup actions local to kernel/torture.c.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
This commit is contained in:
Paul E. McKenney
2014-01-30 14:21:11 -08:00
parent b5daa8f3b3
commit cc47ae0830
3 changed files with 30 additions and 15 deletions

View File

@@ -1423,21 +1423,13 @@ rcu_torture_cleanup(void)
int i;
rcutorture_record_test_transition();
mutex_lock(&fullstop_mutex);
if (fullstop == FULLSTOP_SHUTDOWN) {
pr_warn(/* but going down anyway, so... */
"Concurrent 'rmmod rcutorture' and shutdown illegal!\n");
mutex_unlock(&fullstop_mutex);
schedule_timeout_uninterruptible(10);
if (torture_cleanup()) {
if (cur_ops->cb_barrier != NULL)
cur_ops->cb_barrier();
return;
}
fullstop = FULLSTOP_RMMOD;
mutex_unlock(&fullstop_mutex);
unregister_reboot_notifier(&rcutorture_shutdown_nb);
torture_shuffle_cleanup(); /* Must be first task cleaned up. */
rcu_torture_barrier_cleanup();
rcu_torture_stall_cleanup();
if (stutter_task) {
@@ -1501,7 +1493,6 @@ rcu_torture_cleanup(void)
kthread_stop(shutdown_task);
}
shutdown_task = NULL;
torture_onoff_cleanup();
/* Wait for all RCU callbacks to fire. */