Skip to content

Commit 0616f7e

Browse files
paulmckrcuNeeraj Upadhyay
authored andcommitted
rcu: Mark callbacks not currently participating in barrier operation
RCU keeps a count of the number of callbacks that the current rcu_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 RCU-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 48c21c0 commit 0616f7e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/rcu/tree.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4403,6 +4403,7 @@ static void rcu_barrier_callback(struct rcu_head *rhp)
44034403
{
44044404
unsigned long __maybe_unused s = rcu_state.barrier_sequence;
44054405

4406+
rhp->next = rhp; // Mark the callback as having been invoked.
44064407
if (atomic_dec_and_test(&rcu_state.barrier_cpu_count)) {
44074408
rcu_barrier_trace(TPS("LastCB"), -1, s);
44084409
complete(&rcu_state.barrier_completion);
@@ -5424,6 +5425,8 @@ static void __init rcu_init_one(void)
54245425
while (i > rnp->grphi)
54255426
rnp++;
54265427
per_cpu_ptr(&rcu_data, i)->mynode = rnp;
5428+
per_cpu_ptr(&rcu_data, i)->barrier_head.next =
5429+
&per_cpu_ptr(&rcu_data, i)->barrier_head;
54275430
rcu_boot_init_percpu_data(i);
54285431
}
54295432
}

0 commit comments

Comments
 (0)