linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	torvalds@linux-foundation.org
Subject: Re: [PATCH RFC tip/core/rcu] Restore barrier() to rcu_read_lock() and rcu_read_unlock()
Date: Thu, 6 Jun 2019 06:51:49 -0700	[thread overview]
Message-ID: <20190606135149.GM28207@linux.ibm.com> (raw)
In-Reply-To: <20190606134233.saqa3insjv75xu6o@gondor.apana.org.au>

On Thu, Jun 06, 2019 at 09:42:33PM +0800, Herbert Xu wrote:
> On Thu, Jun 06, 2019 at 06:19:33AM -0700, Paul E. McKenney wrote:
> > Commit bb73c52bad36 ("rcu: Don't disable preemption for Tiny and Tree
> > RCU readers") removed the barrier() calls from rcu_read_lock() and
> > rcu_write_lock() in CONFIG_PREEMPT=n&&CONFIG_PREEMPT_COUNT=n kernels.
> > Within RCU, this commit was OK, but it failed to account for things like
> > get_user() that can pagefault and that can be reordered by the compiler.
> > Lack of the barrier() calls in rcu_read_lock() and rcu_read_unlock()
> > can cause these page faults to migrate into RCU read-side critical
> > sections, which in CONFIG_PREEMPT=n kernels could result in too-short
> > grace periods and arbitrary misbehavior.  Please see commit 386afc91144b
> > ("spinlocks and preemption points need to be at least compiler barriers")
> > for more details.
> > 
> > This commit therefore restores the barrier() call to both rcu_read_lock()
> > and rcu_read_unlock().  It also removes them from places in the RCU update
> > machinery that used to need compensatory barrier() calls, effectively
> > reverting commit bb73c52bad36 ("rcu: Don't disable preemption for Tiny
> > and Tree RCU readers").
> > 
> > Reported-by: Herbert Xu <herbert@gondor.apana.org.au>
> > Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
> 
> Paul, Linus has already commited his patch:
> 
> commit 66be4e66a7f422128748e3c3ef6ee72b20a6197b
> Author: Linus Torvalds <torvalds@linux-foundation.org>
> Date:   Mon Jun 3 13:26:20 2019 -0700
> 
>     rcu: locking and unlocking need to always be at least barriers
> 
> So you'll need to rebase this.

Thank you for letting me know.  Easy enough to do, just remove those
two hunks from my patch.

							Thanx, Paul


      reply	other threads:[~2019-06-06 13:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06 13:19 [PATCH RFC tip/core/rcu] Restore barrier() to rcu_read_lock() and rcu_read_unlock() Paul E. McKenney
2019-06-06 13:42 ` Herbert Xu
2019-06-06 13:51   ` 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=20190606135149.GM28207@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 NNTP newsgroup(s).