public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: "Paul E. McKenney" <paulmck@linux.ibm.com>
Cc: stable@vger.kernel.org, mhillenb@amazon.de, dwmw2@infradead.org,
	peterz@infradead.org, josh@joshtriplett.org, rostedt@goodmis.org,
	mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RCU -stable] Make need_resched() respond to urgent RCU-QS needs
Date: Thu, 29 Nov 2018 13:39:22 +0100	[thread overview]
Message-ID: <20181129123922.GJ3149@kroah.com> (raw)
In-Reply-To: <20181105023434.GA26868@linux.ibm.com>

On Sun, Nov 04, 2018 at 06:34:34PM -0800, Paul E. McKenney wrote:
> commit 92aa39e9dc77 upstream.
> 
> The per-CPU rcu_dynticks.rcu_urgent_qs variable communicates an urgent
> need for an RCU quiescent state from the force-quiescent-state processing
> within the grace-period kthread to context switches and to cond_resched().
> Unfortunately, such urgent needs are not communicated to need_resched(),
> which is sometimes used to decide when to invoke cond_resched(), for
> but one example, within the KVM vcpu_run() function.  As of v4.15, this
> can result in synchronize_sched() being delayed by up to ten seconds,
> which can be problematic, to say nothing of annoying.
> 
> This commit therefore checks rcu_dynticks.rcu_urgent_qs from within
> rcu_check_callbacks(), which is invoked from the scheduling-clock
> interrupt handler.  If the current task is not an idle task and is
> not executing in usermode, a context switch is forced, and either way,
> the rcu_dynticks.rcu_urgent_qs variable is set to false.  If the current
> task is an idle task, then RCU's dyntick-idle code will detect the
> quiescent state, so no further action is required.  Similarly, if the
> task is executing in usermode, other code in rcu_check_callbacks() and
> its called functions will report the corresponding quiescent state.
> 
> Reported-by: Marius Hillenbrand <mhillenb@amazon.de>
> Reported-by: David Woodhouse <dwmw2@infradead.org>
> Suggested-by: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> [ paulmck: Backported to make patch apply cleanly on older versions. ]
> Tested-by: Marius Hillenbrand <mhillenb@amazon.de>
> Cc: <stable@vger.kernel.org> # 4.12.x - 4.19.x
> 

Now queued up, thanks.

greg k-h

      reply	other threads:[~2018-11-29 12:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  2:34 [PATCH RCU -stable] Make need_resched() respond to urgent RCU-QS needs Paul E. McKenney
2018-11-29 12:39 ` Greg KH [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=20181129123922.GJ3149@kroah.com \
    --to=greg@kroah.com \
    --cc=dwmw2@infradead.org \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhillenb@amazon.de \
    --cc=paulmck@linux.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox