/* Test auto-shutdown handling. */
void torture_shutdown_absorb(const char *title);
int torture_shutdown_init(int ssecs, void (*cleanup)(void));
-void torture_shutdown_cleanup(void);
/* Task stuttering, which forces load/no-load transitions. */
void stutter_wait(const char *title);
int torture_stutter_init(int s);
-void torture_stutter_cleanup(void);
/* Initialization and cleanup. */
void torture_init_begin(char *ttype, bool v, int *runnable);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Paul E. McKenney <paulmck@us.ibm.com> and Josh Triplett <josh@freedesktop.org>");
-MODULE_ALIAS("rcutorture");
-#ifdef MODULE_PARAM_PREFIX
-#undef MODULE_PARAM_PREFIX
-#endif
-#define MODULE_PARAM_PREFIX "rcutorture."
torture_param(int, fqs_duration, 0,
"Duration of fqs bursts (us), 0 to disable");
rcu_torture_barrier_cleanup();
torture_stop_kthread(rcu_torture_stall, stall_task);
- torture_stutter_cleanup();
torture_stop_kthread(rcu_torture_writer, writer_task);
if (reader_tasks) {
for_each_possible_cpu(i)
rcutorture_booster_cleanup(i);
}
- torture_shutdown_cleanup();
/* Wait for all RCU callbacks to fire. */
}
EXPORT_SYMBOL_GPL(torture_shutdown_init);
-/*
- * Shut down the shutdown task. Say what??? Heh! This can happen if
- * the torture module gets an rmmod before the shutdown time arrives. ;-)
- */
-void torture_shutdown_cleanup(void)
-{
- if (shutdown_task != NULL) {
- VERBOSE_TOROUT_STRING("Stopping torture_shutdown task");
- kthread_stop(shutdown_task);
- }
- shutdown_task = NULL;
-}
-EXPORT_SYMBOL_GPL(torture_shutdown_cleanup);
-
/*
* Detect and respond to a system shutdown.
*/
.notifier_call = torture_shutdown_notify,
};
+/*
+ * Shut down the shutdown task. Say what??? Heh! This can happen if
+ * the torture module gets an rmmod before the shutdown time arrives. ;-)
+ */
+static void torture_shutdown_cleanup(void)
+{
+ unregister_reboot_notifier(&torture_shutdown_nb);
+ if (shutdown_task != NULL) {
+ VERBOSE_TOROUT_STRING("Stopping torture_shutdown task");
+ kthread_stop(shutdown_task);
+ }
+ shutdown_task = NULL;
+}
+
/*
* Variables for stuttering, which means to periodically pause and
* restart testing in order to catch bugs that appear when load is
/*
* Cleanup after the torture_stutter kthread.
*/
-void torture_stutter_cleanup(void)
+static void torture_stutter_cleanup(void)
{
if (!stutter_task)
return;
kthread_stop(stutter_task);
stutter_task = NULL;
}
-EXPORT_SYMBOL_GPL(torture_stutter_cleanup);
/*
* Initialize torture module. Please note that this is -not- invoked via
* Clean up torture module. Please note that this is -not- invoked via
* the usual module_exit() mechanism, but rather by an explicit call from
* the client torture module. Returns true if a race with system shutdown
- * is detected.
+ * is detected, otherwise, all kthreads started by functions in this file
+ * will be shut down.
*
* This must be called before the caller starts shutting down its own
* kthreads.
}
ACCESS_ONCE(fullstop) = FULLSTOP_RMMOD;
mutex_unlock(&fullstop_mutex);
- unregister_reboot_notifier(&torture_shutdown_nb);
+ torture_shutdown_cleanup();
torture_shuffle_cleanup();
+ torture_stutter_cleanup();
torture_onoff_cleanup();
return false;
}