summaryrefslogtreecommitdiff
path: root/kernel/rcu
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@kernel.org>2020-05-27 16:46:56 -0700
committerPaul E. McKenney <paulmck@kernel.org>2020-06-29 12:00:45 -0700
commit96af8669591d740a1e2695c4d96e544409dbf896 (patch)
tree6416b9234899a38d83287ed9b84082d44cf9d812 /kernel/rcu
parent9d1914d34cebe111a23ab1670633900fd770cec3 (diff)
refperf: Simplify initialization-time wakeup protocol
This commit moves the reader-launch wait loop from ref_perf_init() to main_func(), removing one layer of wakeup and allowing slightly faster system boot. 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.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/kernel/rcu/refperf.c b/kernel/rcu/refperf.c
index 2d2d227d761a..7839237ffc17 100644
--- a/kernel/rcu/refperf.c
+++ b/kernel/rcu/refperf.c
@@ -369,13 +369,14 @@ static int main_func(void *arg)
VERBOSE_PERFOUT_ERRSTRING("out of memory");
errexit = true;
}
- atomic_inc(&n_init);
-
- // Wait for all threads to start.
- wait_event(main_wq, atomic_read(&n_init) == (nreaders + 1));
if (holdoff)
schedule_timeout_interruptible(holdoff * HZ);
+ // Wait for all threads to start.
+ atomic_inc(&n_init);
+ while (atomic_read(&n_init) < nreaders + 1)
+ schedule_timeout_uninterruptible(1);
+
// Start exp readers up per experiment
for (exp = 0; exp < nruns && !torture_must_stop(); exp++) {
if (errexit)
@@ -565,14 +566,6 @@ ref_perf_init(void)
firsterr = torture_create_kthread(main_func, NULL, main_task);
if (firsterr)
goto unwind;
- schedule_timeout_uninterruptible(1);
-
-
- // Wait until all threads start
- while (atomic_read(&n_init) < nreaders + 1)
- schedule_timeout_uninterruptible(1);
-
- wake_up(&main_wq);
torture_init_end();
return 0;