All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Josh Triplett <josh@joshtriplett.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Jiri Kosina <jkosina@suse.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] rcu: Fix up timeouts for forcing the quiescent state
Date: Tue, 8 Sep 2015 13:02:42 -0700	[thread overview]
Message-ID: <20150908200242.GY4029@linux.vnet.ibm.com> (raw)
In-Reply-To: <20150907152102.GC9577@pathway.suse.cz>

On Mon, Sep 07, 2015 at 05:21:02PM +0200, Petr Mladek wrote:
> On Fri 2015-09-04 16:49:46, Paul E. McKenney wrote:
> > On Fri, Sep 04, 2015 at 02:11:30PM +0200, Petr Mladek wrote:
> > > The deadline to force the quiescent state (jiffies_force_qs) is currently
> > > updated only when the previous timeout passed. But the timeout used for
> > > wait_event() is always the entire original timeout. This is strange.
> > 
> > They tell me that kthreads aren't supposed to every catch signals,
> > hence the WARN_ON() in the early-exit case stray-signal case.
> 
> Yup, I have investigated this recently. All signals are really blocked
> for kthreads by default. There are few threads that use signals but
> they explicitly enable it by allow_signal().

Good!  ;-)

> > In the case where we were awakened with an explicit force-quiescent-state
> > request, we do the scan, and then wait the full time for the next scan.
> > So the point of the delay is to space out the scans, not to fit a
> > pre-determined schedule.
> > 
> > The reason we get awakened with an explicit force-quiescent-state
> > request is that a given CPU just got inundated with RCU callbacks
> > or that rcutorture wants to hammer this code path.
> > 
> > So I am not seeing this as anything in need of fixing.
> > 
> > Am I missing something subtle here?
> 
> There is the commit 88d6df612cc3c99f5 ("rcu: Prevent spurious-wakeup
> DoS attack on rcu_gp_kthread()"). It suggests that the spurious
> wakeups are possible.
> 
> I would consider this patch as a fix/clean up of this Dos attack fix.
> Huh, I forgot to mention it in the commit message.
> 
> To be honest, I personally do not know how to trigger the spurious
> wakeup in the current state of the code. I am trying to convert
> the kthread into the kthread worker API and there I got the spurious
> wakeups but this is another story.

You can do it via rcutorture, but that is not an in-production concern.

You can also do it by having all CPUs invoke call_rcu() in a tight loop.

> Thanks a lot for reviewing.

And thank you for your interest in the Linux-kernel RCU implementation!

							Thanx, Paul


      reply	other threads:[~2015-09-08 20:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04 12:11 [PATCH 0/2] rcu: two small fixes for RCU kthreads Petr Mladek
2015-09-04 12:11 ` [PATCH 1/2] rcu: Show the real fqs_state Petr Mladek
2015-09-04 23:24   ` Paul E. McKenney
2015-09-07 14:58     ` Petr Mladek
2015-09-08 19:59       ` Paul E. McKenney
2015-09-09 12:39         ` Petr Mladek
2015-09-09 19:12           ` Paul E. McKenney
2015-09-04 12:11 ` [PATCH 2/2] rcu: Fix up timeouts for forcing the quiescent state Petr Mladek
2015-09-04 23:49   ` Paul E. McKenney
2015-09-07 15:21     ` Petr Mladek
2015-09-08 20:02       ` Paul E. McKenney [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=20150908200242.GY4029@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=jiangshanlai@gmail.com \
    --cc=jkosina@suse.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=pmladek@suse.com \
    --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 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.