mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neeraj Upadhyay <quic_neeraju@quicinc.com>
To: <paulmck@kernel.org>
Cc: <frederic@kernel.org>, <josh@joshtriplett.org>,
	<rostedt@goodmis.org>, <mathieu.desnoyers@efficios.com>,
	<jiangshanlai@gmail.com>, <joel@joelfernandes.org>,
	<linux-kernel@vger.kernel.org>, <boqun.feng@gmail.com>,
	<urezki@gmail.com>
Subject: Re: [PATCH] rcu/tree: Add comment to describe GP done condition in fqs loop
Date: Fri, 10 Jun 2022 08:45:42 +0530	[thread overview]
Message-ID: <2768ac0a-6f39-e6ba-cb57-33cb3b39de2a@quicinc.com> (raw)
In-Reply-To: <20220609202312.GW1790663@paulmck-ThinkPad-P17-Gen-1>



On 6/10/2022 1:53 AM, Paul E. McKenney wrote:
> On Thu, Jun 09, 2022 at 12:43:40PM +0530, Neeraj Upadhyay wrote:
>> Add a comment to explain why !rcu_preempt_blocked_readers_cgp() condition
>> is required on root rnp node, for GP completion check in rcu_gp_fqs_loop().
>>
>> Signed-off-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
> 
> Thank you, Neeraj!  As usual, I could not resist the urge to wordsmith
> as shown below.  Could you please check to see if I messed something up?

Thanks!
> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit bdf3a744d3ad21336a390bfcc2e41de63f193eaf
> Author: Neeraj Upadhyay <quic_neeraju@quicinc.com>
> Date:   Thu Jun 9 12:43:40 2022 +0530
> 
>      rcu/tree: Add comment to describe GP-done condition in fqs loop
>      
>      Add a comment to explain why !rcu_preempt_blocked_readers_cgp() condition
>      is required on root rnp node, for GP completion check in rcu_gp_fqs_loop().
>      
>      Signed-off-by: Neeraj Upadhyay <quic_neeraju@quicinc.com>
>      Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a93c5f4d7e092..9a941e7ee6109 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2083,7 +2083,15 @@ static noinline_for_stack void rcu_gp_fqs_loop(void)
>   		rcu_gp_torture_wait();
>   		WRITE_ONCE(rcu_state.gp_state, RCU_GP_DOING_FQS);
>   		/* Locking provides needed memory barriers. */
> -		/* If grace period done, leave loop. */
> +		/*
> +		 * Exit the loop if the root rcu_node structure indicates that the grace period
> +		 * has ended, leave the loop.  The rcu_preempt_blocked_readers_cgp(rnp) check

We can remove ", leave the loop" ?

> +		 * is required only for single-node rcu_node trees because readers blocking
> +		 * the current grace period are queued only on leaf rcu_node structures.
> +		 * For multi-node trees, checking the root node's ->qsmask suffices, because a
> +		 * given root node's ->qsmask bit is cleared only when all CPUs and tasks from

Do we need to say "a given root node's" , we have only single RCU node 
in the system, so we can just say, "because root node's ->qsmask bit is 
cleared..." ?

> +		 * the corresponding leaf node have passed through their quiescent state.

Change "the corresponding leaf node" to "their corresponding leaf nodes" 
or "the corresponding leaf nodes"?


Thanks
Neeraj

> +		 */
>   		if (!READ_ONCE(rnp->qsmask) &&
>   		    !rcu_preempt_blocked_readers_cgp(rnp))
>   			break;

  reply	other threads:[~2022-06-10  3:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-09  7:13 Neeraj Upadhyay
2022-06-09 20:23 ` Paul E. McKenney
2022-06-10  3:15   ` Neeraj Upadhyay [this message]
2022-06-10  3:41     ` Paul E. McKenney
2022-06-10 16:37 ` Joel Fernandes
2022-06-10 17:00   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2768ac0a-6f39-e6ba-cb57-33cb3b39de2a@quicinc.com \
    --to=quic_neeraju@quicinc.com \
    --cc=boqun.feng@gmail.com \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=urezki@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®