On 3/29/2019 4:57 PM, Neeraj Upadhyay wrote:
Only unlock the root node, if current node (rnp) is not
root node.
Signed-off-by: Neeraj Upadhyay <neeraju@xxxxxxxxxxxxxx>
---
 kernel/rcu/tree_stall.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
index f65a73a..0651833 100644
--- a/kernel/rcu/tree_stall.h
+++ b/kernel/rcu/tree_stall.h
why this is showing as under tree_stall.h while it is under "kernel/rcu/tree.c"
@@ -630,7 +630,9 @@ static void rcu_check_gp_start_stall(struct rcu_node *rnp, struct rcu_data *rdp,
ÂÂÂÂÂÂÂÂÂ time_before(j, rcu_state.gp_req_activity + gpssdelay) ||
ÂÂÂÂÂÂÂÂÂ time_before(j, rcu_state.gp_activity + gpssdelay) ||
ÂÂÂÂÂÂÂÂÂ atomic_xchg(&warned, 1)) {
-ÂÂÂÂÂÂÂ raw_spin_unlock_rcu_node(rnp_root); /* irqs remain disabled. */
+ÂÂÂÂÂÂÂ if (rnp_root != rnp)
+ÂÂÂÂÂÂÂÂÂÂÂ /* irqs remain disabled. */
+ÂÂÂÂÂÂÂÂÂÂÂ raw_spin_unlock_rcu_node(rnp_root);
Looks good as it will balance the lock .if it is the root_node, which was not there earlier, and unlock was happening without any lock on root.
Reviewed-by: Mukesh Ojha <mojha@xxxxxxxxxxxxxx>
Cheers,
-Mukesh
ÂÂÂÂÂÂÂÂÂ raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
ÂÂÂÂÂÂÂÂÂ return;
ÂÂÂÂÂ }