Skip to content

Commit 3ae976a

Browse files
Neeraj UpadhyayPaul E. McKenney
authored andcommitted
rcu: Correctly unlock root node in rcu_check_gp_start_stall()
On systems whose rcu_node tree has only one node, the rcu_check_gp_start_stall() function's values of rnp and rnp_root will be identical. In this case, it clearly does not make sense to release both rnp->lock and rnp_root->lock, but that is exactly what this function does in the last early exit. This commit therefore unlocks only rnp->lock when rnp and rnp_root are equal. Signed-off-by: Neeraj Upadhyay <[email protected]> Reviewed-by: Mukesh Ojha <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent cd6d17b commit 3ae976a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/rcu/tree_stall.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ static void rcu_check_gp_start_stall(struct rcu_node *rnp, struct rcu_data *rdp,
630630
time_before(j, rcu_state.gp_req_activity + gpssdelay) ||
631631
time_before(j, rcu_state.gp_activity + gpssdelay) ||
632632
atomic_xchg(&warned, 1)) {
633-
raw_spin_unlock_rcu_node(rnp_root); /* irqs remain disabled. */
633+
if (rnp_root != rnp)
634+
/* irqs remain disabled. */
635+
raw_spin_unlock_rcu_node(rnp_root);
634636
raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
635637
return;
636638
}

0 commit comments

Comments
 (0)