Skip to content

Commit

Permalink
rcu: Add test code for semaphore-like SRCU readers
Browse files Browse the repository at this point in the history
This commit adds trivial test code for srcu_down_read() and
srcu_up_read().

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
  • Loading branch information
Paul E. McKenney committed Jan 4, 2023
1 parent 0b1182b commit efa3c40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/rcu/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,12 @@ struct early_boot_kfree_rcu {
static void early_boot_test_call_rcu(void)
{
static struct rcu_head head;
int idx;
static struct rcu_head shead;
struct early_boot_kfree_rcu *rhp;

idx = srcu_down_read(&early_srcu);
srcu_up_read(&early_srcu, idx);
call_rcu(&head, test_callback);
early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu);
call_srcu(&early_srcu, &shead, test_callback);
Expand Down

0 comments on commit efa3c40

Please sign in to comment.