All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Zqiang <qiang1.zhang@intel.com>
Cc: paulmck@kernel.org, quic_neeraju@quicinc.com,
	joel@joelfernandes.org, rcu@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp()
Date: Wed, 18 Jan 2023 11:18:47 +0100	[thread overview]
Message-ID: <Y8fHh3jvi/N2kfDB@lothringen> (raw)
In-Reply-To: <20230118073014.2020743-1-qiang1.zhang@intel.com>

On Wed, Jan 18, 2023 at 03:30:14PM +0800, Zqiang wrote:
> When inovke rcu_report_qs_rdp(), if current CPU's rcu_data structure's ->
> grpmask has not been cleared from the corresponding rcu_node structure's
> ->qsmask, after that will clear and report quiescent state, but in this
> time, this also means that current grace period is not end, the current
> grace period is ongoing, because the rcu_gp_in_progress() currently return
> true, so for non-offloaded rdp, invoke rcu_accelerate_cbs() is impossible
> to return true.
> 
> This commit therefore remove impossible rcu_gp_kthread_wake() calling.
> 
> Signed-off-by: Zqiang <qiang1.zhang@intel.com>
> Reviewed-by: Frederic Weisbecker <frederic@kernel.org>

Thanks!

> ---
>  kernel/rcu/tree.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> index b2c204529478..0962c2202d45 100644
> --- a/kernel/rcu/tree.c
> +++ b/kernel/rcu/tree.c
> @@ -1956,7 +1956,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
>  {
>  	unsigned long flags;
>  	unsigned long mask;
> -	bool needwake = false;
>  	bool needacc = false;
>  	struct rcu_node *rnp;
>  
> @@ -1988,7 +1987,12 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
>  		 * NOCB kthreads have their own way to deal with that...
>  		 */
>  		if (!rcu_rdp_is_offloaded(rdp)) {
> -			needwake = rcu_accelerate_cbs(rnp, rdp);
> +			/*
> +			 * Current GP does not end, invoke rcu_gp_in_progress()
> +			 * will return true and so doesn't wake up GP kthread to
> +			 * start a new GP.
> +			 */
> +			WARN_ON_ONCE(rcu_accelerate_cbs(rnp, rdp));
>  		} else if (!rcu_segcblist_completely_offloaded(&rdp->cblist)) {
>  			/*
>  			 * ...but NOCB kthreads may miss or delay callbacks acceleration
> @@ -2000,8 +2004,6 @@ rcu_report_qs_rdp(struct rcu_data *rdp)
>  		rcu_disable_urgency_upon_qs(rdp);
>  		rcu_report_qs_rnp(mask, rnp, rnp->gp_seq, flags);
>  		/* ^^^ Released rnp->lock */
> -		if (needwake)
> -			rcu_gp_kthread_wake();
>  
>  		if (needacc) {
>  			rcu_nocb_lock_irqsave(rdp, flags);
> -- 
> 2.25.1
> 

  reply	other threads:[~2023-01-18 11:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  7:30 [PATCH v3] rcu: Remove impossible wakeup rcu GP kthread action from rcu_report_qs_rdp() Zqiang
2023-01-18 10:18 ` Frederic Weisbecker [this message]
2023-01-18 18:07 ` Paul E. McKenney
2023-01-18 23:30   ` Zhang, Qiang1
2023-01-20  3:14   ` Joel Fernandes
2023-01-20  3:17     ` Joel Fernandes
2023-01-20  4:09     ` Zhang, Qiang1
2023-01-20  4:40       ` Joel Fernandes
2023-01-20  8:19         ` Zhang, Qiang1
2023-01-20 13:27           ` Joel Fernandes
2023-01-20 20:33             ` Paul E. McKenney
2023-01-20 22:35               ` Frederic Weisbecker
2023-01-20 23:20                 ` Paul E. McKenney
2023-01-20 23:04             ` Frederic Weisbecker
2023-01-23 15:22               ` Joel Fernandes
2023-01-23 16:27                 ` Frederic Weisbecker
2023-01-23 20:54                   ` Joel Fernandes
2023-01-23 21:11                     ` Frederic Weisbecker
2023-01-24 16:58                       ` Joel Fernandes
2023-01-21  0:38             ` Zhang, Qiang1
2023-01-24 17:10               ` Joel Fernandes

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=Y8fHh3jvi/N2kfDB@lothringen \
    --to=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=qiang1.zhang@intel.com \
    --cc=quic_neeraju@quicinc.com \
    --cc=rcu@vger.kernel.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 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.