Re: [PATCH RFC 8/8] rcu: Fix cpustart tracepoint gp_seq number

2018-05-14 Thread Joel Fernandes
On Mon, May 14, 2018 at 01:33:20PM -0700, Paul E. McKenney wrote:
> On Sun, May 13, 2018 at 08:15:41PM -0700, Joel Fernandes (Google) wrote:
> > cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated
> > only at the end of the __note_gp_changes function. For this reason, use
> > rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so
> > lets just use the gp_seq from rnp instead.
> > 
> > Signed-off-by: Joel Fernandes (Google) 
> 
> I took this one with the usual commit-log update.  Please take a look!

Looks good, thanks!

- Joel


> 
>   Thanx, Paul
> 
> 
> 
> commit 3e14c6a5225d201776edd9a96d9c9b4435855446
> Author: Joel Fernandes (Google) 
> Date:   Sun May 13 20:15:41 2018 -0700
> 
> rcu: Fix cpustart tracepoint gp_seq number
> 
> The "cpustart" trace event shows a stale gp_seq. This is because it uses
> rdp->gp_seq, which is updated only at the end of the __note_gp_changes()
> function. This commit therefore instead uses rnp->gp_seq.
> 
> An alternative fix would be to update rdp->gp_seq earlier, but this would
> break RCU's detection of the beginning of a new-to-this-CPU grace period.
> 
> Signed-off-by: Joel Fernandes (Google) 
> Signed-off-by: Paul E. McKenney 
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index de6447dd73de..23b855f5c5cb 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1796,7 +1796,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, 
> struct rcu_node *rnp,
>* set up to detect a quiescent state, otherwise don't
>* go looking for one.
>*/
> - trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpustart"));
> + trace_rcu_grace_period(rsp->name, rnp->gp_seq, TPS("cpustart"));
>   need_gp = !!(rnp->qsmask & rdp->grpmask);
>   rdp->cpu_no_qs.b.norm = need_gp;
>   rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_dynticks.rcu_qs_ctr);
> 


Re: [PATCH RFC 8/8] rcu: Fix cpustart tracepoint gp_seq number

2018-05-14 Thread Joel Fernandes
On Mon, May 14, 2018 at 01:33:20PM -0700, Paul E. McKenney wrote:
> On Sun, May 13, 2018 at 08:15:41PM -0700, Joel Fernandes (Google) wrote:
> > cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated
> > only at the end of the __note_gp_changes function. For this reason, use
> > rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so
> > lets just use the gp_seq from rnp instead.
> > 
> > Signed-off-by: Joel Fernandes (Google) 
> 
> I took this one with the usual commit-log update.  Please take a look!

Looks good, thanks!

- Joel


> 
>   Thanx, Paul
> 
> 
> 
> commit 3e14c6a5225d201776edd9a96d9c9b4435855446
> Author: Joel Fernandes (Google) 
> Date:   Sun May 13 20:15:41 2018 -0700
> 
> rcu: Fix cpustart tracepoint gp_seq number
> 
> The "cpustart" trace event shows a stale gp_seq. This is because it uses
> rdp->gp_seq, which is updated only at the end of the __note_gp_changes()
> function. This commit therefore instead uses rnp->gp_seq.
> 
> An alternative fix would be to update rdp->gp_seq earlier, but this would
> break RCU's detection of the beginning of a new-to-this-CPU grace period.
> 
> Signed-off-by: Joel Fernandes (Google) 
> Signed-off-by: Paul E. McKenney 
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index de6447dd73de..23b855f5c5cb 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1796,7 +1796,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, 
> struct rcu_node *rnp,
>* set up to detect a quiescent state, otherwise don't
>* go looking for one.
>*/
> - trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpustart"));
> + trace_rcu_grace_period(rsp->name, rnp->gp_seq, TPS("cpustart"));
>   need_gp = !!(rnp->qsmask & rdp->grpmask);
>   rdp->cpu_no_qs.b.norm = need_gp;
>   rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_dynticks.rcu_qs_ctr);
> 


Re: [PATCH RFC 8/8] rcu: Fix cpustart tracepoint gp_seq number

2018-05-14 Thread Paul E. McKenney
On Sun, May 13, 2018 at 08:15:41PM -0700, Joel Fernandes (Google) wrote:
> cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated
> only at the end of the __note_gp_changes function. For this reason, use
> rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so
> lets just use the gp_seq from rnp instead.
> 
> Signed-off-by: Joel Fernandes (Google) 

I took this one with the usual commit-log update.  Please take a look!

Thanx, Paul



commit 3e14c6a5225d201776edd9a96d9c9b4435855446
Author: Joel Fernandes (Google) 
Date:   Sun May 13 20:15:41 2018 -0700

rcu: Fix cpustart tracepoint gp_seq number

The "cpustart" trace event shows a stale gp_seq. This is because it uses
rdp->gp_seq, which is updated only at the end of the __note_gp_changes()
function. This commit therefore instead uses rnp->gp_seq.

An alternative fix would be to update rdp->gp_seq earlier, but this would
break RCU's detection of the beginning of a new-to-this-CPU grace period.

Signed-off-by: Joel Fernandes (Google) 
Signed-off-by: Paul E. McKenney 

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index de6447dd73de..23b855f5c5cb 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1796,7 +1796,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, 
struct rcu_node *rnp,
 * set up to detect a quiescent state, otherwise don't
 * go looking for one.
 */
-   trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpustart"));
+   trace_rcu_grace_period(rsp->name, rnp->gp_seq, TPS("cpustart"));
need_gp = !!(rnp->qsmask & rdp->grpmask);
rdp->cpu_no_qs.b.norm = need_gp;
rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_dynticks.rcu_qs_ctr);



Re: [PATCH RFC 8/8] rcu: Fix cpustart tracepoint gp_seq number

2018-05-14 Thread Paul E. McKenney
On Sun, May 13, 2018 at 08:15:41PM -0700, Joel Fernandes (Google) wrote:
> cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated
> only at the end of the __note_gp_changes function. For this reason, use
> rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so
> lets just use the gp_seq from rnp instead.
> 
> Signed-off-by: Joel Fernandes (Google) 

I took this one with the usual commit-log update.  Please take a look!

Thanx, Paul



commit 3e14c6a5225d201776edd9a96d9c9b4435855446
Author: Joel Fernandes (Google) 
Date:   Sun May 13 20:15:41 2018 -0700

rcu: Fix cpustart tracepoint gp_seq number

The "cpustart" trace event shows a stale gp_seq. This is because it uses
rdp->gp_seq, which is updated only at the end of the __note_gp_changes()
function. This commit therefore instead uses rnp->gp_seq.

An alternative fix would be to update rdp->gp_seq earlier, but this would
break RCU's detection of the beginning of a new-to-this-CPU grace period.

Signed-off-by: Joel Fernandes (Google) 
Signed-off-by: Paul E. McKenney 

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index de6447dd73de..23b855f5c5cb 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1796,7 +1796,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, 
struct rcu_node *rnp,
 * set up to detect a quiescent state, otherwise don't
 * go looking for one.
 */
-   trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpustart"));
+   trace_rcu_grace_period(rsp->name, rnp->gp_seq, TPS("cpustart"));
need_gp = !!(rnp->qsmask & rdp->grpmask);
rdp->cpu_no_qs.b.norm = need_gp;
rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_dynticks.rcu_qs_ctr);



[PATCH RFC 8/8] rcu: Fix cpustart tracepoint gp_seq number

2018-05-13 Thread Joel Fernandes (Google)
cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated
only at the end of the __note_gp_changes function. For this reason, use
rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so
lets just use the gp_seq from rnp instead.

Signed-off-by: Joel Fernandes (Google) 
---
 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 25c44328d071..58d2b68f8b98 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1807,7 +1807,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, 
struct rcu_node *rnp,
 * set up to detect a quiescent state, otherwise don't
 * go looking for one.
 */
-   trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpustart"));
+   trace_rcu_grace_period(rsp->name, rnp->gp_seq, TPS("cpustart"));
need_gp = !!(rnp->qsmask & rdp->grpmask);
rdp->cpu_no_qs.b.norm = need_gp;
rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_dynticks.rcu_qs_ctr);
-- 
2.17.0.441.gb46fe60e1d-goog



[PATCH RFC 8/8] rcu: Fix cpustart tracepoint gp_seq number

2018-05-13 Thread Joel Fernandes (Google)
cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated
only at the end of the __note_gp_changes function. For this reason, use
rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so
lets just use the gp_seq from rnp instead.

Signed-off-by: Joel Fernandes (Google) 
---
 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 25c44328d071..58d2b68f8b98 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1807,7 +1807,7 @@ static bool __note_gp_changes(struct rcu_state *rsp, 
struct rcu_node *rnp,
 * set up to detect a quiescent state, otherwise don't
 * go looking for one.
 */
-   trace_rcu_grace_period(rsp->name, rdp->gp_seq, TPS("cpustart"));
+   trace_rcu_grace_period(rsp->name, rnp->gp_seq, TPS("cpustart"));
need_gp = !!(rnp->qsmask & rdp->grpmask);
rdp->cpu_no_qs.b.norm = need_gp;
rdp->rcu_qs_ctr_snap = __this_cpu_read(rcu_dynticks.rcu_qs_ctr);
-- 
2.17.0.441.gb46fe60e1d-goog