rcu: Test synchronous RCU grace periods at the end of rcu_init()
authorPaul E. McKenney <paulmck@kernel.org>
Tue, 20 Dec 2022 01:02:20 +0000 (17:02 -0800)
committerPaul E. McKenney <paulmck@kernel.org>
Wed, 4 Jan 2023 01:28:34 +0000 (17:28 -0800)
This commit tests synchronize_rcu() and synchronize_rcu_expedited()
at the end of rcu_init(), in addition to the test already at the
beginning of that function.  These tests are run only in kernels built
with CONFIG_PROVE_RCU=y.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
kernel/rcu/tree.c
kernel/rcu/update.c

index 15f9765064727d038bc7b88cd695d5287e6670a5..80b84ae285b41c6112f5b2e1aa0639af16c4c8ca 100644 (file)
@@ -4849,6 +4849,8 @@ void __init rcu_init(void)
        // Kick-start any polled grace periods that started early.
        if (!(per_cpu_ptr(&rcu_data, cpu)->mynode->exp_seq_poll_rq & 0x1))
                (void)start_poll_synchronize_rcu_expedited();
+
+       rcu_test_sync_prims();
 }
 
 #include "tree_stall.h"
index f5e6a2f95a2a0b00dad748219b1c9c5bbb64c68f..587b97c401914a21ff8921673b955c918a92992f 100644 (file)
@@ -220,6 +220,7 @@ void rcu_test_sync_prims(void)
 {
        if (!IS_ENABLED(CONFIG_PROVE_RCU))
                return;
+       pr_info("Running RCU synchronous self tests\n");
        synchronize_rcu();
        synchronize_rcu_expedited();
 }