All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rcu: Add rnp->expmask output to show_rcu_gp_kthreads()
@ 2022-05-25  4:45 Zqiang
  2022-05-25  4:59 ` Mukesh Ojha
  0 siblings, 1 reply; 4+ messages in thread
From: Zqiang @ 2022-05-25  4:45 UTC (permalink / raw)
  To: paulmck, frederic; +Cc: rcu, linux-kernel

Currently, for expedited rcu we only check 'rnp->exp_tasks', however
the 'rnp->exp_tasks' are not always exist for expedited grace period
that not end. this commit add 'rnp->expmask' condition.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
 kernel/rcu/tree_stall.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
index 2464b0eccfd0..5c4df855f2ac 100644
--- a/kernel/rcu/tree_stall.h
+++ b/kernel/rcu/tree_stall.h
@@ -865,13 +865,15 @@ void show_rcu_gp_kthreads(void)
 	rcu_for_each_node_breadth_first(rnp) {
 		if (ULONG_CMP_GE(READ_ONCE(rcu_state.gp_seq), READ_ONCE(rnp->gp_seq_needed)) &&
 		    !data_race(READ_ONCE(rnp->qsmask)) && !data_race(READ_ONCE(rnp->boost_tasks)) &&
-		    !data_race(READ_ONCE(rnp->exp_tasks)) && !data_race(READ_ONCE(rnp->gp_tasks)))
+		    !data_race(READ_ONCE(rnp->expmask)) && !data_race(READ_ONCE(rnp->exp_tasks)) &&
+			!data_race(READ_ONCE(rnp->gp_tasks)))
 			continue;
-		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld ->qsmask %#lx %c%c%c%c ->n_boosts %ld\n",
+		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld ->qsmask %#lx ->expmask %#lx %c%c%c%c ->n_boosts %ld\n",
 			rnp->grplo, rnp->grphi,
 			(long)data_race(READ_ONCE(rnp->gp_seq)),
 			(long)data_race(READ_ONCE(rnp->gp_seq_needed)),
 			data_race(READ_ONCE(rnp->qsmask)),
+			data_race(READ_ONCE(rnp->expmask)),
 			".b"[!!data_race(READ_ONCE(rnp->boost_kthread_task))],
 			".B"[!!data_race(READ_ONCE(rnp->boost_tasks))],
 			".E"[!!data_race(READ_ONCE(rnp->exp_tasks))],
-- 
2.25.1


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

* Re: [PATCH] rcu: Add rnp->expmask output to show_rcu_gp_kthreads()
  2022-05-25  4:45 [PATCH] rcu: Add rnp->expmask output to show_rcu_gp_kthreads() Zqiang
@ 2022-05-25  4:59 ` Mukesh Ojha
  2022-05-25 14:03   ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Mukesh Ojha @ 2022-05-25  4:59 UTC (permalink / raw)
  To: Zqiang, paulmck, frederic; +Cc: rcu, linux-kernel



On 5/25/2022 10:15 AM, Zqiang wrote:
> Currently, for expedited rcu we only check 'rnp->exp_tasks', however
> the 'rnp->exp_tasks' are not always exist for expedited grace period
> that not end. this commit add 'rnp->expmask' condition.
> 
> Signed-off-by: Zqiang <qiang1.zhang@intel.com>

Thanks !! for the patch.
Commit log could require wordsmith from Paul :-)

Reviewed-by: quic_mojha@quicinc.com

-Mukesh

> ---
>   kernel/rcu/tree_stall.h | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
> index 2464b0eccfd0..5c4df855f2ac 100644
> --- a/kernel/rcu/tree_stall.h
> +++ b/kernel/rcu/tree_stall.h
> @@ -865,13 +865,15 @@ void show_rcu_gp_kthreads(void)
>   	rcu_for_each_node_breadth_first(rnp) {
>   		if (ULONG_CMP_GE(READ_ONCE(rcu_state.gp_seq), READ_ONCE(rnp->gp_seq_needed)) &&
>   		    !data_race(READ_ONCE(rnp->qsmask)) && !data_race(READ_ONCE(rnp->boost_tasks)) &&
> -		    !data_race(READ_ONCE(rnp->exp_tasks)) && !data_race(READ_ONCE(rnp->gp_tasks)))
> +		    !data_race(READ_ONCE(rnp->expmask)) && !data_race(READ_ONCE(rnp->exp_tasks)) &&
> +			!data_race(READ_ONCE(rnp->gp_tasks)))
>   			continue;
> -		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld ->qsmask %#lx %c%c%c%c ->n_boosts %ld\n",
> +		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld ->qsmask %#lx ->expmask %#lx %c%c%c%c ->n_boosts %ld\n",
>   			rnp->grplo, rnp->grphi,
>   			(long)data_race(READ_ONCE(rnp->gp_seq)),
>   			(long)data_race(READ_ONCE(rnp->gp_seq_needed)),
>   			data_race(READ_ONCE(rnp->qsmask)),
> +			data_race(READ_ONCE(rnp->expmask)),
>   			".b"[!!data_race(READ_ONCE(rnp->boost_kthread_task))],
>   			".B"[!!data_race(READ_ONCE(rnp->boost_tasks))],
>   			".E"[!!data_race(READ_ONCE(rnp->exp_tasks))],

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

* Re: [PATCH] rcu: Add rnp->expmask output to show_rcu_gp_kthreads()
  2022-05-25  4:59 ` Mukesh Ojha
@ 2022-05-25 14:03   ` Paul E. McKenney
  2022-05-25 14:42     ` Zhang, Qiang1
  0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2022-05-25 14:03 UTC (permalink / raw)
  To: Mukesh Ojha; +Cc: Zqiang, frederic, rcu, linux-kernel

On Wed, May 25, 2022 at 10:29:23AM +0530, Mukesh Ojha wrote:
> 
> 
> On 5/25/2022 10:15 AM, Zqiang wrote:
> > Currently, for expedited rcu we only check 'rnp->exp_tasks', however
> > the 'rnp->exp_tasks' are not always exist for expedited grace period
> > that not end. this commit add 'rnp->expmask' condition.
> > 
> > Signed-off-by: Zqiang <qiang1.zhang@intel.com>
> 
> Thanks !! for the patch.
> Commit log could require wordsmith from Paul :-)

For Paul to wordsmith this commit log, he must first understand why this
change is useful, keeping in mind that show_rcu_gp_kthreads() is invoked
for normal grace periods, but not for expedited ones.

The point of ->exp_mask for debugging forward-progress issues for normal
grace periods is to understand why tasks blocking the current normal
grace period are not yet being boosted (because the expedited grace
period's boosting takes precedence).  How do these additions help you?

(Not saying that they cannot possibly help you.  I am instead saying
that you must tell me how they have helped you guys.)

							Thanx, Paul

> Reviewed-by: quic_mojha@quicinc.com
> 
> -Mukesh
> 
> > ---
> >   kernel/rcu/tree_stall.h | 6 ++++--
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
> > index 2464b0eccfd0..5c4df855f2ac 100644
> > --- a/kernel/rcu/tree_stall.h
> > +++ b/kernel/rcu/tree_stall.h
> > @@ -865,13 +865,15 @@ void show_rcu_gp_kthreads(void)
> >   	rcu_for_each_node_breadth_first(rnp) {
> >   		if (ULONG_CMP_GE(READ_ONCE(rcu_state.gp_seq), READ_ONCE(rnp->gp_seq_needed)) &&
> >   		    !data_race(READ_ONCE(rnp->qsmask)) && !data_race(READ_ONCE(rnp->boost_tasks)) &&
> > -		    !data_race(READ_ONCE(rnp->exp_tasks)) && !data_race(READ_ONCE(rnp->gp_tasks)))
> > +		    !data_race(READ_ONCE(rnp->expmask)) && !data_race(READ_ONCE(rnp->exp_tasks)) &&
> > +			!data_race(READ_ONCE(rnp->gp_tasks)))
> >   			continue;
> > -		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld ->qsmask %#lx %c%c%c%c ->n_boosts %ld\n",
> > +		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld ->qsmask %#lx ->expmask %#lx %c%c%c%c ->n_boosts %ld\n",
> >   			rnp->grplo, rnp->grphi,
> >   			(long)data_race(READ_ONCE(rnp->gp_seq)),
> >   			(long)data_race(READ_ONCE(rnp->gp_seq_needed)),
> >   			data_race(READ_ONCE(rnp->qsmask)),
> > +			data_race(READ_ONCE(rnp->expmask)),
> >   			".b"[!!data_race(READ_ONCE(rnp->boost_kthread_task))],
> >   			".B"[!!data_race(READ_ONCE(rnp->boost_tasks))],
> >   			".E"[!!data_race(READ_ONCE(rnp->exp_tasks))],

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

* RE: [PATCH] rcu: Add rnp->expmask output to show_rcu_gp_kthreads()
  2022-05-25 14:03   ` Paul E. McKenney
@ 2022-05-25 14:42     ` Zhang, Qiang1
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qiang1 @ 2022-05-25 14:42 UTC (permalink / raw)
  To: paulmck, Mukesh Ojha; +Cc: frederic, rcu, linux-kernel


On Wed, May 25, 2022 at 10:29:23AM +0530, Mukesh Ojha wrote:
> 
> 
> On 5/25/2022 10:15 AM, Zqiang wrote:
> > Currently, for expedited rcu we only check 'rnp->exp_tasks', however 
> > the 'rnp->exp_tasks' are not always exist for expedited grace period 
> > that not end. this commit add 'rnp->expmask' condition.
> > 
> > Signed-off-by: Zqiang <qiang1.zhang@intel.com>
> 
> Thanks !! for the patch.
> Commit log could require wordsmith from Paul :-)

>For Paul to wordsmith this commit log, he must first understand why this change is useful, keeping in mind that show_rcu_gp_kthreads() is invoked for normal grace periods, but not for expedited ones.
>
>The point of ->exp_mask for debugging forward-progress issues for normal grace periods is to understand why tasks blocking the current normal grace period are not yet being boosted (because the expedited grace period's boosting takes precedence).  How do these additions help you?

Hi Paul

Oh sorry, I misunderstood, my previous understanding was only to get the status of the current grace period.
thank you for the explanation.

Thanks
Zqiang 

>
>(Not saying that they cannot possibly help you.  I am instead saying that you must tell me how they have helped you guys.)
>
>							Thanx, Paul

> Reviewed-by: quic_mojha@quicinc.com
> 
> -Mukesh
> 
> > ---
> >   kernel/rcu/tree_stall.h | 6 ++++--
> >   1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h index 
> > 2464b0eccfd0..5c4df855f2ac 100644
> > --- a/kernel/rcu/tree_stall.h
> > +++ b/kernel/rcu/tree_stall.h
> > @@ -865,13 +865,15 @@ void show_rcu_gp_kthreads(void)
> >   	rcu_for_each_node_breadth_first(rnp) {
> >   		if (ULONG_CMP_GE(READ_ONCE(rcu_state.gp_seq), READ_ONCE(rnp->gp_seq_needed)) &&
> >   		    !data_race(READ_ONCE(rnp->qsmask)) && !data_race(READ_ONCE(rnp->boost_tasks)) &&
> > -		    !data_race(READ_ONCE(rnp->exp_tasks)) && !data_race(READ_ONCE(rnp->gp_tasks)))
> > +		    !data_race(READ_ONCE(rnp->expmask)) && !data_race(READ_ONCE(rnp->exp_tasks)) &&
> > +			!data_race(READ_ONCE(rnp->gp_tasks)))
> >   			continue;
> > -		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld ->qsmask %#lx %c%c%c%c ->n_boosts %ld\n",
> > +		pr_info("\trcu_node %d:%d ->gp_seq %ld ->gp_seq_needed %ld 
> > +->qsmask %#lx ->expmask %#lx %c%c%c%c ->n_boosts %ld\n",
> >   			rnp->grplo, rnp->grphi,
> >   			(long)data_race(READ_ONCE(rnp->gp_seq)),
> >   			(long)data_race(READ_ONCE(rnp->gp_seq_needed)),
> >   			data_race(READ_ONCE(rnp->qsmask)),
> > +			data_race(READ_ONCE(rnp->expmask)),
> >   			".b"[!!data_race(READ_ONCE(rnp->boost_kthread_task))],
> >   			".B"[!!data_race(READ_ONCE(rnp->boost_tasks))],
> >   			".E"[!!data_race(READ_ONCE(rnp->exp_tasks))],

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

end of thread, other threads:[~2022-05-25 14:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-25  4:45 [PATCH] rcu: Add rnp->expmask output to show_rcu_gp_kthreads() Zqiang
2022-05-25  4:59 ` Mukesh Ojha
2022-05-25 14:03   ` Paul E. McKenney
2022-05-25 14:42     ` Zhang, Qiang1

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.