aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-02-01 22:19:04 -0500
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-02-20 19:22:01 -0500
commit85ba6bfe8bb2a4d907f7380a8f37b31616ad694e (patch)
tree4e9f5c5a1e822c2de8ea50eb8f4c4668b6a6d25a
parent0da8c08d71133ba0dd9f5b24ae0b6519e00275d6 (diff)
torture: Provide more sensible nreader/nwriter defaults for rcuperf
The default values for nreader and nwriter are apparently not all that user-friendly, resulting in people doing scalability tests that ran all runs at large scale. This commit therefore makes both the nreaders and nwriters module default to the number of CPUs, and adds a comment to rcuperf.c stating that the number of CPUs should be specified using the nr_cpus kernel boot parameter. This commit also eliminates the redundant rcuperf scripting specification of default values for these parameters. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--kernel/rcu/rcuperf.c21
-rw-r--r--tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh24
2 files changed, 21 insertions, 24 deletions
diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index d1ebdf9868bb..777e7a6a0292 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -61,11 +61,30 @@ MODULE_AUTHOR("Paul E. McKenney <paulmck@linux.vnet.ibm.com>");
61#define VERBOSE_PERFOUT_ERRSTRING(s) \ 61#define VERBOSE_PERFOUT_ERRSTRING(s) \
62 do { if (verbose) pr_alert("%s" PERF_FLAG "!!! %s\n", perf_type, s); } while (0) 62 do { if (verbose) pr_alert("%s" PERF_FLAG "!!! %s\n", perf_type, s); } while (0)
63 63
64/*
65 * The intended use cases for the nreaders and nwriters module parameters
66 * are as follows:
67 *
68 * 1. Specify only the nr_cpus kernel boot parameter. This will
69 * set both nreaders and nwriters to the value specified by
70 * nr_cpus for a mixed reader/writer test.
71 *
72 * 2. Specify the nr_cpus kernel boot parameter, but set
73 * rcuperf.nreaders to zero. This will set nwriters to the
74 * value specified by nr_cpus for an update-only test.
75 *
76 * 3. Specify the nr_cpus kernel boot parameter, but set
77 * rcuperf.nwriters to zero. This will set nreaders to the
78 * value specified by nr_cpus for a read-only test.
79 *
80 * Various other use cases may of course be specified.
81 */
82
64torture_param(bool, gp_async, false, "Use asynchronous GP wait primitives"); 83torture_param(bool, gp_async, false, "Use asynchronous GP wait primitives");
65torture_param(int, gp_async_max, 1000, "Max # outstanding waits per reader"); 84torture_param(int, gp_async_max, 1000, "Max # outstanding waits per reader");
66torture_param(bool, gp_exp, false, "Use expedited GP wait primitives"); 85torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
67torture_param(int, holdoff, 10, "Holdoff time before test start (s)"); 86torture_param(int, holdoff, 10, "Holdoff time before test start (s)");
68torture_param(int, nreaders, 0, "Number of RCU reader threads"); 87torture_param(int, nreaders, -1, "Number of RCU reader threads");
69torture_param(int, nwriters, -1, "Number of RCU updater threads"); 88torture_param(int, nwriters, -1, "Number of RCU updater threads");
70torture_param(bool, shutdown, !IS_ENABLED(MODULE), 89torture_param(bool, shutdown, !IS_ENABLED(MODULE),
71 "Shutdown at end of performance tests."); 90 "Shutdown at end of performance tests.");
diff --git a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
index b9603115d7c7..d36b8fd6f0fc 100644
--- a/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
+++ b/tools/testing/selftests/rcutorture/configs/rcuperf/ver_functions.sh
@@ -20,32 +20,10 @@
20# 20#
21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com> 21# Authors: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
22 22
23# rcuperf_param_nreaders bootparam-string
24#
25# Adds nreaders rcuperf module parameter if not already specified.
26rcuperf_param_nreaders () {
27 if ! echo "$1" | grep -q "rcuperf.nreaders"
28 then
29 echo rcuperf.nreaders=-1
30 fi
31}
32
33# rcuperf_param_nwriters bootparam-string
34#
35# Adds nwriters rcuperf module parameter if not already specified.
36rcuperf_param_nwriters () {
37 if ! echo "$1" | grep -q "rcuperf.nwriters"
38 then
39 echo rcuperf.nwriters=-1
40 fi
41}
42
43# per_version_boot_params bootparam-string config-file seconds 23# per_version_boot_params bootparam-string config-file seconds
44# 24#
45# Adds per-version torture-module parameters to kernels supporting them. 25# Adds per-version torture-module parameters to kernels supporting them.
46per_version_boot_params () { 26per_version_boot_params () {
47 echo $1 `rcuperf_param_nreaders "$1"` \ 27 echo $1 rcuperf.shutdown=1 \
48 `rcuperf_param_nwriters "$1"` \
49 rcuperf.shutdown=1 \
50 rcuperf.verbose=1 28 rcuperf.verbose=1
51} 29}