From: Joel Fernandes <joel@joelfernandes.org>
To: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Cc: paulmck@kernel.org, frederic@kernel.org, josh@joshtriplett.org,
rostedt@goodmis.org, mathieu.desnoyers@efficios.com,
jiangshanlai@gmail.com, 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 16:37:39 +0000 [thread overview]
Message-ID: <YqNzUwfII/gJoP52@google.com> (raw)
In-Reply-To: <20220609071340.30375-1-quic_neeraju@quicinc.com>
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>
> ---
> kernel/rcu/tree.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index a93c5f4d7e09..9cd1ba512fdc 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2083,7 +2083,17 @@ 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. */
> + /*
> + * If grace period done, leave loop. rcu_preempt_blocked_readers_cgp(rnp)
> + * check is required for the case where we only have single node in the
> + * rcu_node tree; so, root rcu node is also the leaf node, where readers
> + * blocking current gp are queued. For multi-node tree, checking ->qsmask
> + * on the root node is sufficient, as root rcu node's ->qsmask is only
> + * cleared, when all leaf rcu nodes have propagated their quiescent
> + * state to their parent node, which happens only after both ->qsmask
> + * and rcu_preempt_blocked_readers_cgp(rnp_leaf) are cleared for those
> + * leaf nodes.
> + */
> if (!READ_ONCE(rnp->qsmask) &&
> !rcu_preempt_blocked_readers_cgp(rnp))
> break;
Paul's wording changes are OK with me.
For the patch:
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
thanks,
- Joel
next prev parent reply other threads:[~2022-06-10 16:38 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
2022-06-10 3:41 ` Paul E. McKenney
2022-06-10 16:37 ` Joel Fernandes [this message]
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=YqNzUwfII/gJoP52@google.com \
--to=joel@joelfernandes.org \
--cc=boqun.feng@gmail.com \
--cc=frederic@kernel.org \
--cc=jiangshanlai@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=quic_neeraju@quicinc.com \
--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®