Skip to content

Commit 96af866

Browse files
committed
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) <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent 9d1914d commit 96af866

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

kernel/rcu/refperf.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -369,13 +369,14 @@ static int main_func(void *arg)
369369
VERBOSE_PERFOUT_ERRSTRING("out of memory");
370370
errexit = true;
371371
}
372-
atomic_inc(&n_init);
373-
374-
// Wait for all threads to start.
375-
wait_event(main_wq, atomic_read(&n_init) == (nreaders + 1));
376372
if (holdoff)
377373
schedule_timeout_interruptible(holdoff * HZ);
378374

375+
// Wait for all threads to start.
376+
atomic_inc(&n_init);
377+
while (atomic_read(&n_init) < nreaders + 1)
378+
schedule_timeout_uninterruptible(1);
379+
379380
// Start exp readers up per experiment
380381
for (exp = 0; exp < nruns && !torture_must_stop(); exp++) {
381382
if (errexit)
@@ -565,14 +566,6 @@ ref_perf_init(void)
565566
firsterr = torture_create_kthread(main_func, NULL, main_task);
566567
if (firsterr)
567568
goto unwind;
568-
schedule_timeout_uninterruptible(1);
569-
570-
571-
// Wait until all threads start
572-
while (atomic_read(&n_init) < nreaders + 1)
573-
schedule_timeout_uninterruptible(1);
574-
575-
wake_up(&main_wq);
576569

577570
torture_init_end();
578571
return 0;

0 commit comments

Comments
 (0)