Skip to contentSkip to conversation

rcu: Correct cpu offline trace in rcutree_dying_cpu

PATCH In review Neeraj Upadhyay 2 participants 3 messages Jan 11, 2021 – Jan 13, 2021 RCU

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rcu: Correct cpu offline trace in rcutree_dying_cpu

Correctly trace whether the outgoing cpu blocks current gp in rcutree_dying_cpu().

---
 kernel/rcu/tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/rcu/tree.c +1 -1
index 097990a..1f4bff4 100644
@@ -2364,7 +2364,7 @@ int rcutree_dying_cpu(unsigned int cpu)
 
 	blkd = !!(rnp->qsmask & rdp->grpmask);
 	trace_rcu_grace_period(rcu_state.name, READ_ONCE(rnp->gp_seq),
-			       blkd ? TPS("cpuofl") : TPS("cpuofl-bgp"));
+			       blkd ? TPS("cpuofl-bgp") : TPS("cpuofl"));
 	return 0;
 }
 
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
maintainer
#1 lore raw
Quoted 4 lines · Neeraj Upadhyay

Correctly trace whether the outgoing cpu blocks current gp in rcutree_dying_cpu().

Good catch, queued, thank you! Please see below for my usual wordsmithing, and please lat me know if I messed something up.

Thanx, Paul

------------------------------------------------------------------------

commit ab6e7609e7590e1bb220ef6b0822a823dde46f6c

Author: Neeraj Upadhyay <[email protected]>
Date:   Mon Jan 11 17:15:58 2021 +0530

rcu: Fix CPU-offline trace in rcutree_dying_cpu

The condition in the trace_rcu_grace_period() in rcutree_dying_cpu() is backwards, so that it uses the string "cpuofl" when the offline CPU is blocking the current grace period and "cpuofl-bgp" otherwise. Given that the "-bgp" stands for "blocking grace period", this is at best misleading. This commit therefore switches these strings in order to correctly trace whether the outgoing cpu blocks the current grace period.

kernel/rcu/tree.c +1 -1
index cc6b6fc..63c6dba 100644
@@ -2387,7 +2387,7 @@ int rcutree_dying_cpu(unsigned int cpu)
 
 	blkd = !!(rnp->qsmask & rdp->grpmask);
 	trace_rcu_grace_period(rcu_state.name, READ_ONCE(rnp->gp_seq),
-			       blkd ? TPS("cpuofl") : TPS("cpuofl-bgp"));
+			       blkd ? TPS("cpuofl-bgp") : TPS("cpuofl"));
 	return 0;
 }
 
#2 lore raw
Quoted 11 lines · Paul E. McKenney
Quoted 4 lines · Neeraj Upadhyay

Correctly trace whether the outgoing cpu blocks current gp in rcutree_dying_cpu().

Good catch, queued, thank you! Please see below for my usual wordsmithing, and please lat me know if I messed something up.

Thanx, Paul

Thanks Paul, looks good!

Thanks
Neeraj

Quoted 32 lines

------------------------------------------------------------------------

commit ab6e7609e7590e1bb220ef6b0822a823dde46f6c

Author: Neeraj Upadhyay <[email protected]>
Date:   Mon Jan 11 17:15:58 2021 +0530

rcu: Fix CPU-offline trace in rcutree_dying_cpu

The condition in the trace_rcu_grace_period() in rcutree_dying_cpu() is backwards, so that it uses the string "cpuofl" when the offline CPU is blocking the current grace period and "cpuofl-bgp" otherwise. Given that the "-bgp" stands for "blocking grace period", this is at best misleading. This commit therefore switches these strings in order to correctly trace whether the outgoing cpu blocks the current grace period.

kernel/rcu/tree.c +1 -1
index cc6b6fc..63c6dba 100644
@@ -2387,7 +2387,7 @@ int rcutree_dying_cpu(unsigned int cpu)
 
  	blkd = !!(rnp->qsmask & rdp->grpmask);
  	trace_rcu_grace_period(rcu_state.name, READ_ONCE(rnp->gp_seq),
-			       blkd ? TPS("cpuofl") : TPS("cpuofl-bgp"));
+			       blkd ? TPS("cpuofl-bgp") : TPS("cpuofl"));
  	return 0;
  }
 
Signature · 1 line
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation