Skip to content

Commit e53cef0

Browse files
paulmckrcuNeeraj Upadhyay
authored andcommitted
srcu: Mark callbacks not currently participating in barrier operation
SRCU keeps a count of the number of callbacks that the current srcu_barrier() is waiting on, but there is currently no easy way to work out which callback is stuck. One way to do this is to mark idle SRCU-barrier callbacks by making the ->next pointer point to the callback itself, and this commit does just that. Later commits will use this for debug output. Signed-off-by: "Paul E. McKenney" <[email protected]> Signed-off-by: Neeraj Upadhyay <[email protected]>
1 parent c8c3ae8 commit e53cef0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/rcu/srcutree.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ static void init_srcu_struct_data(struct srcu_struct *ssp)
137137
sdp->srcu_cblist_invoking = false;
138138
sdp->srcu_gp_seq_needed = ssp->srcu_sup->srcu_gp_seq;
139139
sdp->srcu_gp_seq_needed_exp = ssp->srcu_sup->srcu_gp_seq;
140+
sdp->srcu_barrier_head.next = &sdp->srcu_barrier_head;
140141
sdp->mynode = NULL;
141142
sdp->cpu = cpu;
142143
INIT_WORK(&sdp->work, srcu_invoke_callbacks);
@@ -1562,6 +1563,7 @@ static void srcu_barrier_cb(struct rcu_head *rhp)
15621563
struct srcu_data *sdp;
15631564
struct srcu_struct *ssp;
15641565

1566+
rhp->next = rhp; // Mark the callback as having been invoked.
15651567
sdp = container_of(rhp, struct srcu_data, srcu_barrier_head);
15661568
ssp = sdp->ssp;
15671569
if (atomic_dec_and_test(&ssp->srcu_sup->srcu_barrier_cpu_cnt))

0 commit comments

Comments
 (0)