summaryrefslogtreecommitdiff
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-05-25 14:16:44 -0700
committerPaul E. McKenney <paulmck@kernel.org>2020-06-29 12:00:44 -0700
commit777a54c908ec69fa0eccab54068a49ecda38ffde (patch)
treec128debfaf0a1e8942422eb42e7ce89ace0e429e /kernel/rcu
parentf8b4bb23ec014a5d16663ad70b45d9f46c456ec4 (diff)
refperf: Add holdoff parameter to allow CPUs to come online
This commit adds an rcuperf module parameter named "holdoff" that defaults to 10 seconds if refperf is built in and to zero otherwise. The assumption is that all the CPUs are online by the time that the modprobe and insmod commands are going to do anything, and that normal systems will have all the CPUs online within ten seconds. Larger systems may take many tens of seconds or even minutes to get to this point, hence this being a module parameter instead of being a hard-coded constant. Cc: Joel Fernandes (Google) <joel@joelfernandes.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/refperf.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/rcu/refperf.c b/kernel/rcu/refperf.c
index 61161530acc8..4d686fdc3105 100644
--- a/kernel/rcu/refperf.c
+++ b/kernel/rcu/refperf.c
@@ -57,7 +57,10 @@ MODULE_PARM_DESC(perf_type, "Type of test (rcu, srcu, refcnt, rwsem, rwlock.");
torture_param(int, verbose, 0, "Enable verbose debugging printk()s");
-// Number of loops per experiment, all readers execute an operation concurrently
+// Wait until there are multiple CPUs before starting test.
+torture_param(int, holdoff, IS_BUILTIN(CONFIG_RCU_REF_PERF_TEST) ? 10 : 0,
+ "Holdoff time before test start (s)");
+// Number of loops per experiment, all readers execute operations concurrently.
torture_param(long, loops, 10000000, "Number of loops per experiment.");
#ifdef MODULE
@@ -248,6 +251,8 @@ ref_perf_reader(void *arg)
set_cpus_allowed_ptr(current, cpumask_of(me % nr_cpu_ids));
set_user_nice(current, MAX_NICE);
atomic_inc(&n_init);
+ if (holdoff)
+ schedule_timeout_interruptible(holdoff * HZ);
repeat:
VERBOSE_PERFOUT("ref_perf_reader %ld: waiting to start next experiment on cpu %d", me, smp_processor_id());
@@ -357,6 +362,8 @@ static int main_func(void *arg)
// Wait for all threads to start.
wait_event(main_wq, atomic_read(&n_init) == (nreaders + 1));
+ if (holdoff)
+ schedule_timeout_interruptible(holdoff * HZ);
// Start exp readers up per experiment
for (exp = 0; exp < nreaders && !torture_must_stop(); exp++) {
@@ -420,8 +427,8 @@ static void
ref_perf_print_module_parms(struct ref_perf_ops *cur_ops, const char *tag)
{
pr_alert("%s" PERF_FLAG
- "--- %s: verbose=%d shutdown=%d loops=%ld\n", perf_type, tag,
- verbose, shutdown, loops);
+ "--- %s: verbose=%d shutdown=%d holdoff=%d loops=%ld\n", perf_type, tag,
+ verbose, shutdown, holdoff, loops);
}
static void