Messages in this thread Patch in this message | | | Date | Wed, 30 Jun 2021 13:47:26 -0000 | From | "tip-bot2 for Frederic Weisbecker" <> | Subject | [tip: core/rcu] srcu: Early test SRCU polling start |
| |
The following commit has been merged into the core/rcu branch of tip:
Commit-ID: 0a580fa65cfa08a40af1a0a2cf73d100863e4981 Gitweb: https://git.kernel.org/tip/0a580fa65cfa08a40af1a0a2cf73d100863e4981 Author: Frederic Weisbecker <frederic@kernel.org> AuthorDate: Wed, 14 Apr 2021 15:24:13 +02:00 Committer: Paul E. McKenney <paulmck@kernel.org> CommitterDate: Wed, 12 May 2021 12:12:33 -07:00
srcu: Early test SRCU polling start
Place an early call to start_poll_synchronize_srcu() before the invocation of call_srcu() on the same srcu_struct structure.
After the later call to srcu_barrier(), the completion of the first grace period should be visible to a subsequent invocation of poll_state_synchronize_srcu(), and if not, warn.
Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: Neeraj Upadhyay <neeraju@codeaurora.org> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Joel Fernandes <joel@joelfernandes.org> Cc: Uladzislau Rezki <urezki@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> --- kernel/rcu/update.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index b95ae86..0aa118a 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -524,6 +524,7 @@ static void test_callback(struct rcu_head *r) } DEFINE_STATIC_SRCU(early_srcu); +static unsigned long early_srcu_cookie; struct early_boot_kfree_rcu { struct rcu_head rh; @@ -536,8 +537,10 @@ static void early_boot_test_call_rcu(void) struct early_boot_kfree_rcu *rhp; call_rcu(&head, test_callback); - if (IS_ENABLED(CONFIG_SRCU)) + if (IS_ENABLED(CONFIG_SRCU)) { + early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu); call_srcu(&early_srcu, &shead, test_callback); + } rhp = kmalloc(sizeof(*rhp), GFP_KERNEL); if (!WARN_ON_ONCE(!rhp)) kfree_rcu(rhp, rh); @@ -563,6 +566,7 @@ static int rcu_verify_early_boot_tests(void) if (IS_ENABLED(CONFIG_SRCU)) { early_boot_test_counter++; srcu_barrier(&early_srcu); + WARN_ON_ONCE(!poll_state_synchronize_srcu(&early_srcu, early_srcu_cookie)); } } if (rcu_self_test_counter != early_boot_test_counter) {
| |