From: Joel Fernandes <joel@joelfernandes.org>
To: "Neeraj Upadhyay (AMD)" <neeraj.iitr10@gmail.com>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, rostedt@goodmis.org, paulmck@kernel.org,
Neeraj.Upadhyay@amd.com, Zqiang <qiang.zhang1211@gmail.com>
Subject: Re: [PATCH rcu 3/3] rcu: Force quiescent states only for ongoing grace period
Date: Tue, 12 Dec 2023 18:22:33 -0500 [thread overview]
Message-ID: <CAEXW_YQSPfv50=KNKp-rBVNDPw+XkQ5tUxbVZUL5TW0VVUvVuA@mail.gmail.com> (raw)
In-Reply-To: <20231212174004.11754-3-neeraj.iitr10@gmail.com>
On Tue, Dec 12, 2023 at 12:40 PM Neeraj Upadhyay (AMD)
<neeraj.iitr10@gmail.com> wrote:
>
> From: Zqiang <qiang.zhang1211@gmail.com>
>
> If an rcutorture test scenario creates an fqs_task kthread, it will
> periodically invoke rcu_force_quiescent_state() in order to start
> force-quiescent-state (FQS) operations. However, an FQS operation
> will be started even if there is no RCU grace period in progress.
> Although testing FQS operations startup when there is no grace period in
> progress is necessary, it need not happen all that often. This commit
> therefore causes rcu_force_quiescent_state() to take an early exit
> if there is no grace period in progress.
>
> Note that there will still be attempts to start an FQS scan in the
> absence of a grace period because the grace period might end right
> after the rcu_force_quiescent_state() function's check. In actual
> testing, this happens about once every ten minutes, which should
> provide adequate testing.
>
> Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> Signed-off-by: Neeraj Upadhyay (AMD) <neeraj.iitr10@gmail.com>
> ---
> kernel/rcu/tree.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index 3ac3c846105f..1ae851777806 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -2338,6 +2338,8 @@ void rcu_force_quiescent_state(void)
> struct rcu_node *rnp;
> struct rcu_node *rnp_old = NULL;
>
> + if (!rcu_gp_in_progress())
> + return;
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
(Probably no need to resend with the tag, just update the patch in the PR).
Thanks.
prev parent reply other threads:[~2023-12-12 23:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-12 17:39 [PATCH rcu 0/3] RCU misc fixes for v6.8 Neeraj Upadhyay (AMD)
2023-12-12 17:40 ` [PATCH rcu 1/3] rcu: Restrict access to RCU CPU stall notifiers Neeraj Upadhyay (AMD)
2023-12-12 17:40 ` [PATCH rcu 2/3] rcu: Remove unused macros from rcupdate.h Neeraj Upadhyay (AMD)
2023-12-12 17:40 ` [PATCH rcu 3/3] rcu: Force quiescent states only for ongoing grace period Neeraj Upadhyay (AMD)
2023-12-12 23:22 ` Joel Fernandes [this message]
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='CAEXW_YQSPfv50=KNKp-rBVNDPw+XkQ5tUxbVZUL5TW0VVUvVuA@mail.gmail.com' \
--to=joel@joelfernandes.org \
--cc=Neeraj.Upadhyay@amd.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neeraj.iitr10@gmail.com \
--cc=paulmck@kernel.org \
--cc=qiang.zhang1211@gmail.com \
--cc=rcu@vger.kernel.org \
--cc=rostedt@goodmis.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).