RCU Archive on lore.kernel.org
 help / color / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: "Joel Fernandes (Google)" <joel@joelfernandes.org>
Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, frederic@kernel.org
Subject: Re: [PATCH v2 -rcu dev 2/3] rcu/tree: Fix issue where sometimes rcu_urgent_qs is not set on IPI
Date: Fri, 16 Aug 2019 10:04:57 -0700
Message-ID: <20190816170457.GT28441@linux.ibm.com> (raw)
In-Reply-To: <20190816025914.GB242309@google.com>

On Thu, Aug 15, 2019 at 10:59:14PM -0400, Joel Fernandes (Google) wrote:
> Sometimes I see rcu_urgent_qs is not set. This could be when the last
> IPI was a long time ago, however, the grace period just started. Set
> rcu_urgent_qs so the tick can indeed not be stopped.
> 
> Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>

Great catch, queued, thank you!  I updated the commit log as shown below,
so could you please check to see if I messed anything up?

							Thanx, Paul

------------------------------------------------------------------------

commit 1f80df1e49b29ccd605882056a0565778e100e9e
Author: Joel Fernandes (Google) <joel@joelfernandes.org>
Date:   Thu Aug 15 22:59:14 2019 -0400

    rcu/tree: Ensure that ->rcu_urgent_qs is set before resched IPI
    
    The RCU-specific resched_cpu() function sends a resched IPI to the
    specified CPU, which can be used to force the tick on for a given
    nohz_full CPU.  This is needed when this nohz_full CPU is looping in the
    kernel while blocking the current grace period.  However, for the tick
    to actually be forced on in all cases, that CPU's rcu_data structure's
    ->rcu_urgent_qs flag must be set beforehand.  This commit therefore
    causes rcu_implicit_dynticks_qs() to set this flag prior to invoking
    resched_cpu() on a holdout nohz_full CPU.
    
    Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
    Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 0512de9ead20..dd0a77bffa7d 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1091,6 +1091,7 @@ static int rcu_implicit_dynticks_qs(struct rcu_data *rdp)
 	if (tick_nohz_full_cpu(rdp->cpu) &&
 		   time_after(jiffies,
 			      READ_ONCE(rdp->last_fqs_resched) + jtsq * 3)) {
+		WRITE_ONCE(*ruqp, true);
 		resched_cpu(rdp->cpu);
 		WRITE_ONCE(rdp->last_fqs_resched, jiffies);
 	}

  reply index

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16  2:53 [PATCH -rcu dev 1/3] rcu/tree: tick_dep_set/clear_cpu should accept bits instead of masks Joel Fernandes (Google)
2019-08-16  2:53 ` [PATCH -rcu dev 2/3] rcu/tree: Fix issue where sometimes rcu_urgent_qs is not set on IPI Joel Fernandes (Google)
2019-08-16  2:57   ` Joel Fernandes
2019-08-16  2:53 ` [PATCH -rcu dev 3/3] RFC: rcu/tree: Read dynticks_nmi_nesting in advance Joel Fernandes (Google)
2019-08-16 16:24   ` Joel Fernandes
2019-08-16 16:52     ` Paul E. McKenney
2019-08-16 17:07       ` Joel Fernandes
2019-08-16 17:30         ` Paul E. McKenney
2019-08-19 12:59       ` Frederic Weisbecker
2019-08-19 14:22         ` Joel Fernandes
2019-08-19 14:41           ` Paul E. McKenney
2019-08-19 15:46             ` Joel Fernandes
2019-08-19 16:17               ` Paul E. McKenney
2019-08-19 14:40         ` Paul E. McKenney
2019-08-16  2:59 ` [PATCH v2 -rcu dev 2/3] rcu/tree: Fix issue where sometimes rcu_urgent_qs is not set on IPI Joel Fernandes (Google)
2019-08-16 17:04   ` Paul E. McKenney [this message]
2019-08-16 17:25 ` [PATCH -rcu dev 1/3] rcu/tree: tick_dep_set/clear_cpu should accept bits instead of masks Paul E. McKenney
2019-08-16 17:35   ` Joel Fernandes
2019-08-19 12:38 ` Frederic Weisbecker
2019-08-19 14:46   ` Paul E. McKenney
2019-08-19 16:32     ` Frederic Weisbecker
2019-08-19 16:44       ` Paul E. McKenney
2019-08-20 12:08         ` Frederic Weisbecker
2019-08-20 14:44           ` Paul E. McKenney

Reply instructions:

You may reply publically 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=20190816170457.GT28441@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=frederic@kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

RCU Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/rcu/0 rcu/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 rcu rcu/ https://lore.kernel.org/rcu \
		rcu@vger.kernel.org
	public-inbox-index rcu

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.rcu


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git