RCU Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rcu: Correct cpu offline trace in rcutree_dying_cpu
@ 2021-01-11 11:45 Neeraj Upadhyay
  2021-01-12 17:31 ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Neeraj Upadhyay @ 2021-01-11 11:45 UTC (permalink / raw)
  To: paulmck, josh, rostedt, mathieu.desnoyers, jiangshanlai, joel
  Cc: rcu, linux-kernel, Neeraj Upadhyay

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

Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
---
 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 097990a..1f4bff4 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -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;
 }
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rcu: Correct cpu offline trace in rcutree_dying_cpu
  2021-01-11 11:45 [PATCH] rcu: Correct cpu offline trace in rcutree_dying_cpu Neeraj Upadhyay
@ 2021-01-12 17:31 ` Paul E. McKenney
  2021-01-13  5:11   ` Neeraj Upadhyay
  0 siblings, 1 reply; 3+ messages in thread
From: Paul E. McKenney @ 2021-01-12 17:31 UTC (permalink / raw)
  To: Neeraj Upadhyay
  Cc: josh, rostedt, mathieu.desnoyers, jiangshanlai, joel, rcu, linux-kernel

On Mon, Jan 11, 2021 at 05:15:58PM +0530, Neeraj Upadhyay wrote:
> Correctly trace whether the outgoing cpu blocks current gp in
> rcutree_dying_cpu().
> 
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>

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 <neeraju@codeaurora.org>
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.
    
    Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index cc6b6fc..63c6dba 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -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;
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rcu: Correct cpu offline trace in rcutree_dying_cpu
  2021-01-12 17:31 ` Paul E. McKenney
@ 2021-01-13  5:11   ` Neeraj Upadhyay
  0 siblings, 0 replies; 3+ messages in thread
From: Neeraj Upadhyay @ 2021-01-13  5:11 UTC (permalink / raw)
  To: paulmck
  Cc: josh, rostedt, mathieu.desnoyers, jiangshanlai, joel, rcu, linux-kernel



On 1/12/2021 11:01 PM, Paul E. McKenney wrote:
> On Mon, Jan 11, 2021 at 05:15:58PM +0530, Neeraj Upadhyay wrote:
>> Correctly trace whether the outgoing cpu blocks current gp in
>> rcutree_dying_cpu().
>>
>> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> 
> 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

> ------------------------------------------------------------------------
> 
> commit ab6e7609e7590e1bb220ef6b0822a823dde46f6c
> Author: Neeraj Upadhyay <neeraju@codeaurora.org>
> 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.
>      
>      Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
>      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index cc6b6fc..63c6dba 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -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;
>   }
>   
> 

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member of the Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 11:45 [PATCH] rcu: Correct cpu offline trace in rcutree_dying_cpu Neeraj Upadhyay
2021-01-12 17:31 ` Paul E. McKenney
2021-01-13  5:11   ` Neeraj Upadhyay

RCU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/rcu/0 rcu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 rcu rcu/ https://lore.kernel.org/rcu \
		rcu@vger.kernel.org
	public-inbox-index rcu

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.rcu


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git