aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutorture.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2008-06-18 12:26:49 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-19 05:22:15 -0400
commit31a72bce0bd6f3e0114009288bccbc96376eeeca (patch)
tree14a817fbe0b47511d3119360c47959d48f851140 /kernel/rcutorture.c
parentd120f65f3aaf306c957bc4c82e510f5b0f1e9b27 (diff)
rcu: make rcutorture more vicious: reinstate boot-time testing
This patch re-institutes the ability to build rcutorture directly into the Linux kernel. The reason that this capability was removed was that this could result in your kernel being pretty much useless, as rcutorture would be running starting from early boot. This problem has been avoided by (1) making rcutorture run only three seconds of every six by default, (2) adding a CONFIG_RCU_TORTURE_TEST_RUNNABLE that permits rcutorture to be quiesced at boot time, and (3) adding a sysctl in /proc named /proc/sys/kernel/rcutorture_runnable that permits rcutorture to be quiesced and unquiesced when built into the kernel. Please note that this /proc file is -not- available when rcutorture is built as a module. Please also note that to get the earlier take-no-prisoners behavior, you must use the boot command line to set rcutorture's "stutter" parameter to zero. The rcutorture quiescing mechanism is currently quite crude: loops in each rcutorture process that poll a global variable once per tick. Suggestions for improvement are welcome. The default action will be to reduce the polling rate to a few times per second. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Suggested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutorture.c')
-rw-r--r--kernel/rcutorture.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 98ae7d16822..27003e2421c 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -125,6 +125,13 @@ static struct list_head rcu_torture_removed;
125 125
126static int stutter_pause_test = 0; 126static int stutter_pause_test = 0;
127 127
128#if defined(MODULE) || defined(CONFIG_RCU_TORTURE_TEST_RUNNABLE)
129#define RCUTORTURE_RUNNABLE_INIT 1
130#else
131#define RCUTORTURE_RUNNABLE_INIT 0
132#endif
133int rcutorture_runnable = RCUTORTURE_RUNNABLE_INIT;
134
128/* 135/*
129 * Allocate an element from the rcu_tortures pool. 136 * Allocate an element from the rcu_tortures pool.
130 */ 137 */
@@ -188,7 +195,7 @@ rcu_random(struct rcu_random_state *rrsp)
188static void 195static void
189rcu_stutter_wait(void) 196rcu_stutter_wait(void)
190{ 197{
191 while (stutter_pause_test) 198 while (stutter_pause_test || !rcutorture_runnable)
192 schedule_timeout_interruptible(1); 199 schedule_timeout_interruptible(1);
193} 200}
194 201