Commit efa3c40c authored by Paul E. McKenney's avatar Paul E. McKenney

rcu: Add test code for semaphore-like SRCU readers

This commit adds trivial test code for srcu_down_read() and
srcu_up_read().
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 0b1182bd
...@@ -555,9 +555,12 @@ struct early_boot_kfree_rcu { ...@@ -555,9 +555,12 @@ struct early_boot_kfree_rcu {
static void early_boot_test_call_rcu(void) static void early_boot_test_call_rcu(void)
{ {
static struct rcu_head head; static struct rcu_head head;
int idx;
static struct rcu_head shead; static struct rcu_head shead;
struct early_boot_kfree_rcu *rhp; struct early_boot_kfree_rcu *rhp;
idx = srcu_down_read(&early_srcu);
srcu_up_read(&early_srcu, idx);
call_rcu(&head, test_callback); call_rcu(&head, test_callback);
early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu); early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu);
call_srcu(&early_srcu, &shead, test_callback); call_srcu(&early_srcu, &shead, test_callback);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment