summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-01-29 16:40:27 +0100
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-23 18:01:04 +0100
commitf67a33561e6e5463b548219df98130da95f2e4a7 (patch)
tree6cdbf7152900045acb4f0f9d5426f995adf0ba66 /include
parentrcutorture: Abstract TOROUT_STRING() and friends (diff)
downloadlinux-f67a33561e6e5463b548219df98130da95f2e4a7.tar.xz
linux-f67a33561e6e5463b548219df98130da95f2e4a7.zip
rcutorture: Abstract torture_shutdown_absorb()
Because handling races between rmmod and normal shutdown is not specific to rcutorture, this commit renames rcutorture_shutdown_absorb() to torture_shutdown_absorb() and pulls it out into then kernel/torture.c module. This implies pulling the fullstop mechanism into kernel/torture.c as well. The exporting of fullstop and fullstop_mutex is ugly and must die. And it does in fact die in later commits that introduce higher-level APIs that encapsulate both of these variables. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>`
Diffstat (limited to 'include')
-rw-r--r--include/linux/torture.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h
index 09be8887fb08..8474d776c864 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -41,6 +41,18 @@
module_param(name, type, 0444); \
MODULE_PARM_DESC(name, msg);
+/* Mediate rmmod and system shutdown. Concurrent rmmod & shutdown illegal! */
+#define FULLSTOP_DONTSTOP 0 /* Normal operation. */
+#define FULLSTOP_SHUTDOWN 1 /* System shutdown with rcutorture running. */
+#define FULLSTOP_RMMOD 2 /* Normal rmmod of rcutorture. */
+extern int fullstop;
+/* Protect fullstop transitions and spawning of kthreads. */
+extern struct mutex fullstop_mutex;
+
+/* Common module parameters. */
+extern char *torture_type;
+extern bool verbose;
+
#define TORTURE_FLAG "-torture:"
#define TOROUT_STRING(s) \
pr_alert("%s" TORTURE_FLAG s "\n", torture_type)
@@ -57,4 +69,7 @@ struct torture_random_state {
#define DEFINE_TORTURE_RANDOM(name) struct torture_random_state name = { 0, 0 }
unsigned long torture_random(struct torture_random_state *trsp);
+/* Shutdown task absorption, for when the tasks cannot safely be killed. */
+void torture_shutdown_absorb(const char *title);
+
#endif /* __LINUX_TORTURE_H */