From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Joel Fernandes <joel@joelfernandes.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu
Date: Tue, 30 Oct 2018 16:43:36 -0700 [thread overview]
Message-ID: <20181030234336.GW4170@linux.ibm.com> (raw)
In-Reply-To: <20181030222649.GA105735@joelaf.mtv.corp.google.com>
On Tue, Oct 30, 2018 at 03:26:49PM -0700, Joel Fernandes wrote:
> Hi Paul,
>
> On Sat, Oct 27, 2018 at 09:30:46PM -0700, Joel Fernandes (Google) wrote:
> > As per this thread [1], it seems this smp_mb isn't needed anymore:
> > "So the smp_mb() that I was trying to add doesn't need to be there."
> >
> > So let us remove this part from the memory ordering documentation.
> >
> > [1] https://lkml.org/lkml/2017/10/6/707
> >
> > Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
>
> I was just checking about this patch. Do you feel it is correct to remove
> this part from the docs? Are you satisified that a barrier isn't needed there
> now? Or did I miss something?
Apologies, it got lost in the shuffle. I have now applied it with a
bit of rework to the commit log, thank you!
Thanx, Paul
> thanks,
>
> - Joel
>
>
> > ---
> > .../Tree-RCU-Memory-Ordering.html | 32 +------------------
> > 1 file changed, 1 insertion(+), 31 deletions(-)
> >
> > diff --git a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html
> > index a346ce0116eb..0fb1511763d4 100644
> > --- a/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html
> > +++ b/Documentation/RCU/Design/Memory-Ordering/Tree-RCU-Memory-Ordering.html
> > @@ -77,7 +77,7 @@ The key point is that the lock-acquisition functions, including
> > <tt>smp_mb__after_unlock_lock()</tt> immediately after successful
> > acquisition of the lock.
> >
> > -<p>Therefore, for any given <tt>rcu_node</tt> struction, any access
> > +<p>Therefore, for any given <tt>rcu_node</tt> structure, any access
> > happening before one of the above lock-release functions will be seen
> > by all CPUs as happening before any access happening after a later
> > one of the above lock-acquisition functions.
> > @@ -162,36 +162,6 @@ an <tt>atomic_add_return()</tt> of zero) to detect idle CPUs.
> > <tr><td> </td></tr>
> > </table>
> >
> > -<p>The approach must be extended to handle one final case, that
> > -of waking a task blocked in <tt>synchronize_rcu()</tt>.
> > -This task might be affinitied to a CPU that is not yet aware that
> > -the grace period has ended, and thus might not yet be subject to
> > -the grace period's memory ordering.
> > -Therefore, there is an <tt>smp_mb()</tt> after the return from
> > -<tt>wait_for_completion()</tt> in the <tt>synchronize_rcu()</tt>
> > -code path.
> > -
> > -<table>
> > -<tr><th> </th></tr>
> > -<tr><th align="left">Quick Quiz:</th></tr>
> > -<tr><td>
> > - What? Where???
> > - I don't see any <tt>smp_mb()</tt> after the return from
> > - <tt>wait_for_completion()</tt>!!!
> > -</td></tr>
> > -<tr><th align="left">Answer:</th></tr>
> > -<tr><td bgcolor="#ffffff"><font color="ffffff">
> > - That would be because I spotted the need for that
> > - <tt>smp_mb()</tt> during the creation of this documentation,
> > - and it is therefore unlikely to hit mainline before v4.14.
> > - Kudos to Lance Roy, Will Deacon, Peter Zijlstra, and
> > - Jonathan Cameron for asking questions that sensitized me
> > - to the rather elaborate sequence of events that demonstrate
> > - the need for this memory barrier.
> > -</font></td></tr>
> > -<tr><td> </td></tr>
> > -</table>
> > -
> > <p>Tree RCU's grace--period memory-ordering guarantees rely most
> > heavily on the <tt>rcu_node</tt> structure's <tt>->lock</tt>
> > field, so much so that it is necessary to abbreviate this pattern
> > --
> > 2.19.1.568.g152ad8e336-goog
> >
>
next prev parent reply other threads:[~2018-10-30 23:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-28 4:30 [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu Joel Fernandes (Google)
2018-10-30 22:26 ` Joel Fernandes
2018-10-30 23:43 ` Paul E. McKenney [this message]
2018-10-31 1:11 ` Joel Fernandes
2018-10-31 18:17 ` Paul E. McKenney
2018-11-01 5:00 ` Joel Fernandes
2018-11-01 16:13 ` Paul E. McKenney
2018-11-02 6:15 ` Joel Fernandes
2018-11-02 20:00 ` Paul E. McKenney
2018-11-02 22:14 ` Joel Fernandes
2018-11-02 22:24 ` Paul E. McKenney
2018-11-03 5:12 ` Joel Fernandes
2018-11-03 23:22 ` Paul E. McKenney
2018-11-04 3:49 ` Joel Fernandes
2018-11-05 3:43 ` Paul E. McKenney
2018-11-05 4:43 ` 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=20181030234336.GW4170@linux.ibm.com \
--to=paulmck@linux.ibm.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@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.