aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-11-21 23:19:17 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-12-11 12:18:29 -0500
commita2f2577d96ad060b65eb909dd39b57d676754119 (patch)
treef05ed19020bde2f8998d5a8e1ac873bfd7c5d8be
parent4ced3314fd3a73dabac4e8a41747883eff36c3e8 (diff)
torture: Eliminate torture_runnable and perf_runnable
The purpose of torture_runnable is to allow rcutorture and locktorture to be started and stopped via sysfs when they are built into the kernel (as in not compiled as loadable modules). However, the 0444 permissions for both instances of torture_runnable prevent this use case from ever being put into practice. Given that there have been no complaints about this deficiency, it is reasonable to conclude that no one actually makes use of this sysfs capability. The perf_runnable module parameter for rcuperf is in the same situation. This commit therefore removes both torture_runnable instances as well as perf_runnable. Reported-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt9
-rw-r--r--Documentation/locking/locktorture.txt5
-rw-r--r--include/linux/torture.h2
-rw-r--r--kernel/locking/locktorture.c6
-rw-r--r--kernel/rcu/rcuperf.c6
-rw-r--r--kernel/rcu/rcutorture.c6
-rw-r--r--kernel/torture.c6
-rw-r--r--tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh1
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh1
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh1
10 files changed, 6 insertions, 37 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 6571fbfdb2a1..66d471f0b92e 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -2049,9 +2049,6 @@
2049 This tests the locking primitive's ability to 2049 This tests the locking primitive's ability to
2050 transition abruptly to and from idle. 2050 transition abruptly to and from idle.
2051 2051
2052 locktorture.torture_runnable= [BOOT]
2053 Start locktorture running at boot time.
2054
2055 locktorture.torture_type= [KNL] 2052 locktorture.torture_type= [KNL]
2056 Specify the locking implementation to test. 2053 Specify the locking implementation to test.
2057 2054
@@ -3459,9 +3456,6 @@
3459 the same as for rcuperf.nreaders. 3456 the same as for rcuperf.nreaders.
3460 N, where N is the number of CPUs 3457 N, where N is the number of CPUs
3461 3458
3462 rcuperf.perf_runnable= [BOOT]
3463 Start rcuperf running at boot time.
3464
3465 rcuperf.perf_type= [KNL] 3459 rcuperf.perf_type= [KNL]
3466 Specify the RCU implementation to test. 3460 Specify the RCU implementation to test.
3467 3461
@@ -3595,9 +3589,6 @@
3595 Test RCU's dyntick-idle handling. See also the 3589 Test RCU's dyntick-idle handling. See also the
3596 rcutorture.shuffle_interval parameter. 3590 rcutorture.shuffle_interval parameter.
3597 3591
3598 rcutorture.torture_runnable= [BOOT]
3599 Start rcutorture running at boot time.
3600
3601 rcutorture.torture_type= [KNL] 3592 rcutorture.torture_type= [KNL]
3602 Specify the RCU implementation to test. 3593 Specify the RCU implementation to test.
3603 3594
diff --git a/Documentation/locking/locktorture.txt b/Documentation/locking/locktorture.txt
index a2ef3a929bf1..6a8df4cd19bf 100644
--- a/Documentation/locking/locktorture.txt
+++ b/Documentation/locking/locktorture.txt
@@ -57,11 +57,6 @@ torture_type Type of lock to torture. By default, only spinlocks will
57 57
58 o "rwsem_lock": read/write down() and up() semaphore pairs. 58 o "rwsem_lock": read/write down() and up() semaphore pairs.
59 59
60torture_runnable Start locktorture at boot time in the case where the
61 module is built into the kernel, otherwise wait for
62 torture_runnable to be set via sysfs before starting.
63 By default it will begin once the module is loaded.
64
65 60
66 ** Torture-framework (RCU + locking) ** 61 ** Torture-framework (RCU + locking) **
67 62
diff --git a/include/linux/torture.h b/include/linux/torture.h
index 907d266aaddc..66272862070b 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -79,7 +79,7 @@ void stutter_wait(const char *title);
79int torture_stutter_init(int s); 79int torture_stutter_init(int s);
80 80
81/* Initialization and cleanup. */ 81/* Initialization and cleanup. */
82bool torture_init_begin(char *ttype, bool v, int *runnable); 82bool torture_init_begin(char *ttype, bool v);
83void torture_init_end(void); 83void torture_init_end(void);
84bool torture_cleanup_begin(void); 84bool torture_cleanup_begin(void);
85void torture_cleanup_end(void); 85void torture_cleanup_end(void);
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 2a1fc2a58910..6850ffd69125 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -77,10 +77,6 @@ struct lock_stress_stats {
77 long n_lock_acquired; 77 long n_lock_acquired;
78}; 78};
79 79
80int torture_runnable = IS_ENABLED(MODULE);
81module_param(torture_runnable, int, 0444);
82MODULE_PARM_DESC(torture_runnable, "Start locktorture at module init");
83
84/* Forward reference. */ 80/* Forward reference. */
85static void lock_torture_cleanup(void); 81static void lock_torture_cleanup(void);
86 82
@@ -866,7 +862,7 @@ static int __init lock_torture_init(void)
866 &percpu_rwsem_lock_ops, 862 &percpu_rwsem_lock_ops,
867 }; 863 };
868 864
869 if (!torture_init_begin(torture_type, verbose, &torture_runnable)) 865 if (!torture_init_begin(torture_type, verbose))
870 return -EBUSY; 866 return -EBUSY;
871 867
872 /* Process args and tell the world that the torturer is on the job. */ 868 /* Process args and tell the world that the torturer is on the job. */
diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index 1f87a02c3399..d1ebdf9868bb 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -106,10 +106,6 @@ static int rcu_perf_writer_state;
106#define MAX_MEAS 10000 106#define MAX_MEAS 10000
107#define MIN_MEAS 100 107#define MIN_MEAS 100
108 108
109static int perf_runnable = IS_ENABLED(MODULE);
110module_param(perf_runnable, int, 0444);
111MODULE_PARM_DESC(perf_runnable, "Start rcuperf at boot");
112
113/* 109/*
114 * Operations vector for selecting different types of tests. 110 * Operations vector for selecting different types of tests.
115 */ 111 */
@@ -646,7 +642,7 @@ rcu_perf_init(void)
646 &tasks_ops, 642 &tasks_ops,
647 }; 643 };
648 644
649 if (!torture_init_begin(perf_type, verbose, &perf_runnable)) 645 if (!torture_init_begin(perf_type, verbose))
650 return -EBUSY; 646 return -EBUSY;
651 647
652 /* Process args and tell the world that the perf'er is on the job. */ 648 /* Process args and tell the world that the perf'er is on the job. */
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 1074ecc3f72f..308e6fdbced8 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -187,10 +187,6 @@ static const char *rcu_torture_writer_state_getname(void)
187 return rcu_torture_writer_state_names[i]; 187 return rcu_torture_writer_state_names[i];
188} 188}
189 189
190static int torture_runnable = IS_ENABLED(MODULE);
191module_param(torture_runnable, int, 0444);
192MODULE_PARM_DESC(torture_runnable, "Start rcutorture at boot");
193
194#if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU) 190#if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU)
195#define rcu_can_boost() 1 191#define rcu_can_boost() 1
196#else /* #if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU) */ 192#else /* #if defined(CONFIG_RCU_BOOST) && !defined(CONFIG_HOTPLUG_CPU) */
@@ -1729,7 +1725,7 @@ rcu_torture_init(void)
1729 &sched_ops, &tasks_ops, 1725 &sched_ops, &tasks_ops,
1730 }; 1726 };
1731 1727
1732 if (!torture_init_begin(torture_type, verbose, &torture_runnable)) 1728 if (!torture_init_begin(torture_type, verbose))
1733 return -EBUSY; 1729 return -EBUSY;
1734 1730
1735 /* Process args and tell the world that the torturer is on the job. */ 1731 /* Process args and tell the world that the torturer is on the job. */
diff --git a/kernel/torture.c b/kernel/torture.c
index 3bcbd4fbfe18..572576ad9f58 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -61,7 +61,6 @@ static bool verbose;
61#define FULLSTOP_RMMOD 2 /* Normal rmmod of torture. */ 61#define FULLSTOP_RMMOD 2 /* Normal rmmod of torture. */
62static int fullstop = FULLSTOP_RMMOD; 62static int fullstop = FULLSTOP_RMMOD;
63static DEFINE_MUTEX(fullstop_mutex); 63static DEFINE_MUTEX(fullstop_mutex);
64static int *torture_runnable;
65 64
66#ifdef CONFIG_HOTPLUG_CPU 65#ifdef CONFIG_HOTPLUG_CPU
67 66
@@ -577,7 +576,7 @@ void stutter_wait(const char *title)
577 576
578 cond_resched_rcu_qs(); 577 cond_resched_rcu_qs();
579 spt = READ_ONCE(stutter_pause_test); 578 spt = READ_ONCE(stutter_pause_test);
580 while (spt || (torture_runnable && !READ_ONCE(*torture_runnable))) { 579 while (spt) {
581 if (spt == 1) { 580 if (spt == 1) {
582 schedule_timeout_interruptible(1); 581 schedule_timeout_interruptible(1);
583 } else if (spt == 2) { 582 } else if (spt == 2) {
@@ -649,7 +648,7 @@ static void torture_stutter_cleanup(void)
649 * The runnable parameter points to a flag that controls whether or not 648 * The runnable parameter points to a flag that controls whether or not
650 * the test is currently runnable. If there is no such flag, pass in NULL. 649 * the test is currently runnable. If there is no such flag, pass in NULL.
651 */ 650 */
652bool torture_init_begin(char *ttype, bool v, int *runnable) 651bool torture_init_begin(char *ttype, bool v)
653{ 652{
654 mutex_lock(&fullstop_mutex); 653 mutex_lock(&fullstop_mutex);
655 if (torture_type != NULL) { 654 if (torture_type != NULL) {
@@ -661,7 +660,6 @@ bool torture_init_begin(char *ttype, bool v, int *runnable)
661 } 660 }
662 torture_type = ttype; 661 torture_type = ttype;
663 verbose = v; 662 verbose = v;
664 torture_runnable = runnable;
665 fullstop = FULLSTOP_DONTSTOP; 663 fullstop = FULLSTOP_DONTSTOP;
666 return true; 664 return true;
667} 665}
diff --git a/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh
index 252aae618984..80eb646e1319 100644
--- a/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/lock/ver_functions.sh
@@ -38,6 +38,5 @@ per_version_boot_params () {
38 echo $1 `locktorture_param_onoff "$1" "$2"` \ 38 echo $1 `locktorture_param_onoff "$1" "$2"` \
39 locktorture.stat_interval=15 \ 39 locktorture.stat_interval=15 \
40 locktorture.shutdown_secs=$3 \ 40 locktorture.shutdown_secs=$3 \
41 locktorture.torture_runnable=1 \
42 locktorture.verbose=1 41 locktorture.verbose=1
43} 42}
diff --git a/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh
index ffb85ed786fa..24ec91041957 100644
--- a/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/rcu/ver_functions.sh
@@ -51,7 +51,6 @@ per_version_boot_params () {
51 `rcutorture_param_n_barrier_cbs "$1"` \ 51 `rcutorture_param_n_barrier_cbs "$1"` \
52 rcutorture.stat_interval=15 \ 52 rcutorture.stat_interval=15 \
53 rcutorture.shutdown_secs=$3 \ 53 rcutorture.shutdown_secs=$3 \
54 rcutorture.torture_runnable=1 \
55 rcutorture.test_no_idle_hz=1 \ 54 rcutorture.test_no_idle_hz=1 \
56 rcutorture.verbose=1 55 rcutorture.verbose=1
57} 56}
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
index 34f2a1b35ee5..b9603115d7c7 100644
--- a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
@@ -46,7 +46,6 @@ rcuperf_param_nwriters () {
46per_version_boot_params () { 46per_version_boot_params () {
47 echo $1 `rcuperf_param_nreaders "$1"` \ 47 echo $1 `rcuperf_param_nreaders "$1"` \
48 `rcuperf_param_nwriters "$1"` \ 48 `rcuperf_param_nwriters "$1"` \
49 rcuperf.perf_runnable=1 \
50 rcuperf.shutdown=1 \ 49 rcuperf.shutdown=1 \
51 rcuperf.verbose=1 50 rcuperf.verbose=1
52} 51}