aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/torture.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-04-24 11:21:40 -0700
committerPaul E. McKenney <paulmck@kernel.org>2020-06-29 12:01:44 -0700
commit4a5f133c15b77c4018e8d7996541868ac94afb4f (patch)
treea1c6e163474556b611a7490dd47bd1ad33db05c7 /include/linux/torture.h
parentlocktorture: Use true and false to assign to bool variables (diff)
downloadlinux-dev-4a5f133c15b77c4018e8d7996541868ac94afb4f.tar.xz
linux-dev-4a5f133c15b77c4018e8d7996541868ac94afb4f.zip
rcutorture: Add races with task-exit processing
Several variants of Linux-kernel RCU interact with task-exit processing, including preemptible RCU, Tasks RCU, and Tasks Trace RCU. This commit therefore adds testing of this interaction to rcutorture by adding rcutorture.read_exit_burst and rcutorture.read_exit_delay kernel-boot parameters. These kernel parameters control the frequency and spacing of special read-then-exit kthreads that are spawned. [ paulmck: Apply feedback from Dan Carpenter's static checker. ] [ paulmck: Reduce latency to avoid false-positive shutdown hangs. ] Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'include/linux/torture.h')
-rw-r--r--include/linux/torture.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h
index 629b66e6c161..7f65bd1dd307 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -55,6 +55,11 @@ struct torture_random_state {
#define DEFINE_TORTURE_RANDOM_PERCPU(name) \
DEFINE_PER_CPU(struct torture_random_state, name)
unsigned long torture_random(struct torture_random_state *trsp);
+static inline void torture_random_init(struct torture_random_state *trsp)
+{
+ trsp->trs_state = 0;
+ trsp->trs_count = 0;
+}
/* Task shuffler, which causes CPUs to occasionally go idle. */
void torture_shuffle_task_register(struct task_struct *tp);