Skip to content

Commit

Permalink
rcu: Test synchronous RCU grace periods at the end of rcu_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul E. McKenney committed Jan 4, 2023
1 parent 3d1adf7 commit 748bf47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/rcu/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions kernel/rcu/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 748bf47

Please sign in to comment.