[tip: core/rcu] rcu: Fix CPU-offline trace in rcutree_dying_cpu

From: tip-bot2 for Neeraj Upadhyay
Date: Sun Apr 11 2021 - 09:48:31 EST


The following commit has been merged into the core/rcu branch of tip:

Commit-ID: 47fcbc8dd62f15dc75916225ebacdc3bca9c12b2
Gitweb: https://git.kernel.org/tip/47fcbc8dd62f15dc75916225ebacdc3bca9c12b2
Author: Neeraj Upadhyay <neeraju@xxxxxxxxxxxxxx>
AuthorDate: Mon, 11 Jan 2021 17:15:58 +05:30
Committer: Paul E. McKenney <paulmck@xxxxxxxxxx>
CommitterDate: Mon, 08 Mar 2021 14:17:35 -08:00

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.

Signed-off-by: Neeraj Upadhyay <neeraju@xxxxxxxxxxxxxx>
Signed-off-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
---
kernel/rcu/tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index cdf091f..e62c2de 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2413,7 +2413,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;
}