Skip to content

Commit efa3c40

Browse files
committed
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: Paul E. McKenney <[email protected]>
1 parent 0b1182b commit efa3c40

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/rcu/update.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,12 @@ struct early_boot_kfree_rcu {
555555
static void early_boot_test_call_rcu(void)
556556
{
557557
static struct rcu_head head;
558+
int idx;
558559
static struct rcu_head shead;
559560
struct early_boot_kfree_rcu *rhp;
560561

562+
idx = srcu_down_read(&early_srcu);
563+
srcu_up_read(&early_srcu, idx);
561564
call_rcu(&head, test_callback);
562565
early_srcu_cookie = start_poll_synchronize_srcu(&early_srcu);
563566
call_srcu(&early_srcu, &shead, test_callback);

0 commit comments

Comments
 (0)