aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/torture.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-01-31 20:37:28 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2014-02-23 12:03:21 -0500
commit7fafaac5b9ce22cc57777865390520476ad2262d (patch)
treec857b24b21d277b45803878af0715c817fb4716a /include/linux/torture.h
parent14562d1cf12b434da2c69b5603a4149ac43f3b48 (diff)
rcutorture: Fix rcutorture shutdown races
Not all of the rcutorture kthreads waited for kthread_should_stop() before returning from their top-level functions, and none of them used torture_shutdown_absorb() properly. These problems can result in segfaults and hangs at shutdown time, and some recent changes perturbed timing sufficiently to make them much more probable. This commit therefore creates a torture_kthread_stopping() function that does the proper kthread shutdown dance in one centralized location. Accommodate this grouping by making VERBOSE_TOROUT_STRING() capable of taking a non-const string as its argument, which allows the new torture_kthread_stopping() to pass its "title" argument directly to the updated version of VERBOSE_TOROUT_STRING(). Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/torture.h')
-rw-r--r--include/linux/torture.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h
index c79c41d543ef..2ea11094daf6 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -45,7 +45,7 @@
45#define TOROUT_STRING(s) \ 45#define TOROUT_STRING(s) \
46 pr_alert("%s" TORTURE_FLAG s "\n", torture_type) 46 pr_alert("%s" TORTURE_FLAG s "\n", torture_type)
47#define VERBOSE_TOROUT_STRING(s) \ 47#define VERBOSE_TOROUT_STRING(s) \
48 do { if (verbose) pr_alert("%s" TORTURE_FLAG s "\n", torture_type); } while (0) 48 do { if (verbose) pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); } while (0)
49#define VERBOSE_TOROUT_ERRSTRING(s) \ 49#define VERBOSE_TOROUT_ERRSTRING(s) \
50 do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0) 50 do { if (verbose) pr_alert("%s" TORTURE_FLAG "!!! " s "\n", torture_type); } while (0)
51 51
@@ -88,5 +88,6 @@ void torture_init_end(void);
88bool torture_cleanup(void); 88bool torture_cleanup(void);
89bool torture_must_stop(void); 89bool torture_must_stop(void);
90bool torture_must_stop_irq(void); 90bool torture_must_stop_irq(void);
91void torture_kthread_stopping(char *title);
91 92
92#endif /* __LINUX_TORTURE_H */ 93#endif /* __LINUX_TORTURE_H */