aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcutorture.c9
-rw-r--r--kernel/sysctl.c13
2 files changed, 21 insertions, 1 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 98ae7d168225..27003e2421c7 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
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 29116652dca8..c6887cf135c8 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -82,6 +82,9 @@ extern int maps_protect;
82extern int sysctl_stat_interval; 82extern int sysctl_stat_interval;
83extern int latencytop_enabled; 83extern int latencytop_enabled;
84extern int sysctl_nr_open_min, sysctl_nr_open_max; 84extern int sysctl_nr_open_min, sysctl_nr_open_max;
85#ifdef CONFIG_RCU_TORTURE_TEST
86extern int rcutorture_runnable;
87#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
85 88
86/* Constants used for minimum and maximum */ 89/* Constants used for minimum and maximum */
87#if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM) 90#if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM)
@@ -813,6 +816,16 @@ static struct ctl_table kern_table[] = {
813 .child = key_sysctls, 816 .child = key_sysctls,
814 }, 817 },
815#endif 818#endif
819#ifdef CONFIG_RCU_TORTURE_TEST
820 {
821 .ctl_name = CTL_UNNUMBERED,
822 .procname = "rcutorture_runnable",
823 .data = &rcutorture_runnable,
824 .maxlen = sizeof(int),
825 .mode = 0644,
826 .proc_handler = &proc_dointvec,
827 },
828#endif
816/* 829/*
817 * NOTE: do not add new entries to this table unless you have read 830 * NOTE: do not add new entries to this table unless you have read
818 * Documentation/sysctl/ctl_unnumbered.txt 831 * Documentation/sysctl/ctl_unnumbered.txt