summaryrefslogtreecommitdiffstats
path: root/kernel/torture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-04 11:47:08 -0800
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-23 09:04:25 -0800
commit9c029b86098decd4660eec511b8d2d42da3e7dd9 (patch)
treea108dd697afee54ef25db8303aaa71c7b28e37aa /kernel/torture.c
parent47cf29b9e721967aac95ebda9e50408219755852 (diff)
downloadop-kernel-dev-9c029b86098decd4660eec511b8d2d42da3e7dd9.zip
op-kernel-dev-9c029b86098decd4660eec511b8d2d42da3e7dd9.tar.gz
rcutorture: Abstract torture_stop_kthread()
Stopping of kthreads is not RCU-specific, so this commit abstracts out torture_stop_kthread(), saving a few lines of code in the process. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/torture.c')
-rw-r--r--kernel/torture.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/torture.c b/kernel/torture.c
index 4394518..871f636 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -700,3 +700,16 @@ int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m,
return ret;
}
EXPORT_SYMBOL_GPL(_torture_create_kthread);
+
+/*
+ * Stop a generic kthread, emitting a message.
+ */
+void _torture_stop_kthread(char *m, struct task_struct **tp)
+{
+ if (*tp == NULL)
+ return;
+ VERBOSE_TOROUT_STRING(m);
+ kthread_stop(*tp);
+ *tp = NULL;
+}
+EXPORT_SYMBOL_GPL(_torture_stop_kthread);
OpenPOWER on IntegriCloud