linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire()
@ 2018-07-10 10:02 Andrea Parri
  2018-07-10 14:34 ` Andrea Parri
  2018-07-11 13:08 ` Andrea Parri
  0 siblings, 2 replies; 6+ messages in thread
From: Andrea Parri @ 2018-07-10 10:02 UTC (permalink / raw)
  To: linux-kernel, linux-arch, linux-doc
  Cc: Andrea Parri, Alan Stern, Will Deacon, Peter Zijlstra,
	Boqun Feng, Nicholas Piggin, David Howells, Jade Alglave,
	Luc Maranget, Paul E. McKenney, Akira Yokosawa, Daniel Lustig,
	Jonathan Corbet

Amend commit 1f03e8d2919270 ("locking/barriers: Replace smp_cond_acquire()
with smp_cond_load_acquire()") by updating the documentation accordingly.

Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jade Alglave <j.alglave@ucl.ac.uk>
Cc: Luc Maranget <luc.maranget@inria.fr>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Akira Yokosawa <akiyks@gmail.com>
Cc: Daniel Lustig <dlustig@nvidia.com>
Cc: Jonathan Corbet <corbet@lwn.net>
---
 Documentation/memory-barriers.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 0d8d7ef131e9a..987a4e6cc0cd8 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -471,8 +471,8 @@ And a couple of implicit varieties:
      operations after the ACQUIRE operation will appear to happen after the
      ACQUIRE operation with respect to the other components of the system.
      ACQUIRE operations include LOCK operations and both smp_load_acquire()
-     and smp_cond_acquire() operations. The later builds the necessary ACQUIRE
-     semantics from relying on a control dependency and smp_rmb().
+     and smp_cond_load_acquire() operations. The later builds the necessary
+     ACQUIRE semantics from relying on a control dependency and smp_rmb().
 
      Memory operations that occur before an ACQUIRE operation may appear to
      happen after it completes.
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire()
  2018-07-10 10:02 [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire() Andrea Parri
@ 2018-07-10 14:34 ` Andrea Parri
  2018-07-11 13:08 ` Andrea Parri
  1 sibling, 0 replies; 6+ messages in thread
From: Andrea Parri @ 2018-07-10 14:34 UTC (permalink / raw)
  To: linux-kernel, linux-arch, linux-doc
  Cc: Alan Stern, Will Deacon, Peter Zijlstra, Boqun Feng,
	Nicholas Piggin, David Howells, Jade Alglave, Luc Maranget,
	Paul E. McKenney, Akira Yokosawa, Daniel Lustig, Jonathan Corbet

On Tue, Jul 10, 2018 at 12:02:23PM +0200, Andrea Parri wrote:
> Amend commit 1f03e8d2919270 ("locking/barriers: Replace smp_cond_acquire()
> with smp_cond_load_acquire()") by updating the documentation accordingly.
> 
> Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Jade Alglave <j.alglave@ucl.ac.uk>
> Cc: Luc Maranget <luc.maranget@inria.fr>
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Cc: Akira Yokosawa <akiyks@gmail.com>
> Cc: Daniel Lustig <dlustig@nvidia.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> ---
>  Documentation/memory-barriers.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> index 0d8d7ef131e9a..987a4e6cc0cd8 100644
> --- a/Documentation/memory-barriers.txt
> +++ b/Documentation/memory-barriers.txt
> @@ -471,8 +471,8 @@ And a couple of implicit varieties:
>       operations after the ACQUIRE operation will appear to happen after the
>       ACQUIRE operation with respect to the other components of the system.
>       ACQUIRE operations include LOCK operations and both smp_load_acquire()
> -     and smp_cond_acquire() operations. The later builds the necessary ACQUIRE
> -     semantics from relying on a control dependency and smp_rmb().
> +     and smp_cond_load_acquire() operations. The later builds the necessary
> +     ACQUIRE semantics from relying on a control dependency and smp_rmb().

Still not completely accurate: smp_rmb() would better be replaced by
smp_acquire__after_ctrl_dep() (arm64 excluded).  Mmh... I think I'll
just remove that "The latter builds the [...]" and resend; thoughts?

  Andrea


>  
>       Memory operations that occur before an ACQUIRE operation may appear to
>       happen after it completes.
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire()
  2018-07-10 10:02 [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire() Andrea Parri
  2018-07-10 14:34 ` Andrea Parri
@ 2018-07-11 13:08 ` Andrea Parri
  2018-07-11 15:38   ` Paul E. McKenney
  1 sibling, 1 reply; 6+ messages in thread
From: Andrea Parri @ 2018-07-11 13:08 UTC (permalink / raw)
  To: linux-kernel, linux-arch, linux-doc
  Cc: Andrea Parri, Alan Stern, Will Deacon, Peter Zijlstra,
	Boqun Feng, Nicholas Piggin, David Howells, Jade Alglave,
	Luc Maranget, Paul E. McKenney, Akira Yokosawa, Daniel Lustig,
	Jonathan Corbet

Amend commit 1f03e8d2919270 ("locking/barriers: Replace smp_cond_acquire()
with smp_cond_load_acquire()") by updating the documentation accordingly.
Also remove some obsolete information related to the implementation.

Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Jade Alglave <j.alglave@ucl.ac.uk>
Cc: Luc Maranget <luc.maranget@inria.fr>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Akira Yokosawa <akiyks@gmail.com>
Cc: Daniel Lustig <dlustig@nvidia.com>
Cc: Jonathan Corbet <corbet@lwn.net>
---
 Documentation/memory-barriers.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
index 0d8d7ef131e9a..c1d913944ad8b 100644
--- a/Documentation/memory-barriers.txt
+++ b/Documentation/memory-barriers.txt
@@ -471,8 +471,7 @@ And a couple of implicit varieties:
      operations after the ACQUIRE operation will appear to happen after the
      ACQUIRE operation with respect to the other components of the system.
      ACQUIRE operations include LOCK operations and both smp_load_acquire()
-     and smp_cond_acquire() operations. The later builds the necessary ACQUIRE
-     semantics from relying on a control dependency and smp_rmb().
+     and smp_cond_load_acquire() operations.
 
      Memory operations that occur before an ACQUIRE operation may appear to
      happen after it completes.
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire()
  2018-07-11 13:08 ` Andrea Parri
@ 2018-07-11 15:38   ` Paul E. McKenney
  2018-07-11 15:53     ` Andrea Parri
  0 siblings, 1 reply; 6+ messages in thread
From: Paul E. McKenney @ 2018-07-11 15:38 UTC (permalink / raw)
  To: Andrea Parri
  Cc: linux-kernel, linux-arch, linux-doc, Alan Stern, Will Deacon,
	Peter Zijlstra, Boqun Feng, Nicholas Piggin, David Howells,
	Jade Alglave, Luc Maranget, Akira Yokosawa, Daniel Lustig,
	Jonathan Corbet

On Wed, Jul 11, 2018 at 03:08:50PM +0200, Andrea Parri wrote:
> Amend commit 1f03e8d2919270 ("locking/barriers: Replace smp_cond_acquire()
> with smp_cond_load_acquire()") by updating the documentation accordingly.
> Also remove some obsolete information related to the implementation.
> 
> Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> Cc: Alan Stern <stern@rowland.harvard.edu>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Boqun Feng <boqun.feng@gmail.com>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: David Howells <dhowells@redhat.com>
> Cc: Jade Alglave <j.alglave@ucl.ac.uk>
> Cc: Luc Maranget <luc.maranget@inria.fr>
> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> Cc: Akira Yokosawa <akiyks@gmail.com>
> Cc: Daniel Lustig <dlustig@nvidia.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> ---
>  Documentation/memory-barriers.txt | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

I have queued this for further review, thank you!  Just to confirm,
the reason that the old passage was obsolete is because ARMv8 implements
smp_cond_load_acquire() as a straight acquire load, correct?

							Thanx, Paul

> diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> index 0d8d7ef131e9a..c1d913944ad8b 100644
> --- a/Documentation/memory-barriers.txt
> +++ b/Documentation/memory-barriers.txt
> @@ -471,8 +471,7 @@ And a couple of implicit varieties:
>       operations after the ACQUIRE operation will appear to happen after the
>       ACQUIRE operation with respect to the other components of the system.
>       ACQUIRE operations include LOCK operations and both smp_load_acquire()
> -     and smp_cond_acquire() operations. The later builds the necessary ACQUIRE
> -     semantics from relying on a control dependency and smp_rmb().
> +     and smp_cond_load_acquire() operations.
> 
>       Memory operations that occur before an ACQUIRE operation may appear to
>       happen after it completes.
> -- 
> 2.7.4
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire()
  2018-07-11 15:38   ` Paul E. McKenney
@ 2018-07-11 15:53     ` Andrea Parri
  2018-07-11 16:11       ` Paul E. McKenney
  0 siblings, 1 reply; 6+ messages in thread
From: Andrea Parri @ 2018-07-11 15:53 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, linux-arch, linux-doc, Alan Stern, Will Deacon,
	Peter Zijlstra, Boqun Feng, Nicholas Piggin, David Howells,
	Jade Alglave, Luc Maranget, Akira Yokosawa, Daniel Lustig,
	Jonathan Corbet

On Wed, Jul 11, 2018 at 08:38:40AM -0700, Paul E. McKenney wrote:
> On Wed, Jul 11, 2018 at 03:08:50PM +0200, Andrea Parri wrote:
> > Amend commit 1f03e8d2919270 ("locking/barriers: Replace smp_cond_acquire()
> > with smp_cond_load_acquire()") by updating the documentation accordingly.
> > Also remove some obsolete information related to the implementation.
> > 
> > Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> > Cc: Alan Stern <stern@rowland.harvard.edu>
> > Cc: Will Deacon <will.deacon@arm.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Boqun Feng <boqun.feng@gmail.com>
> > Cc: Nicholas Piggin <npiggin@gmail.com>
> > Cc: David Howells <dhowells@redhat.com>
> > Cc: Jade Alglave <j.alglave@ucl.ac.uk>
> > Cc: Luc Maranget <luc.maranget@inria.fr>
> > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > Cc: Akira Yokosawa <akiyks@gmail.com>
> > Cc: Daniel Lustig <dlustig@nvidia.com>
> > Cc: Jonathan Corbet <corbet@lwn.net>
> > ---
> >  Documentation/memory-barriers.txt | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> I have queued this for further review, thank you!  Just to confirm,
> the reason that the old passage was obsolete is because ARMv8 implements
> smp_cond_load_acquire() as a straight acquire load, correct?

Thanks.  Yes; the generic code builds on a control dependency and an
smp_acquire__after_ctrl_dep() (which defaults to smp_rmb()); but the
required ordering on arm64 is given by (its) smp_load_acquire().

I thought that entering this level of details (and keeping it up-to-
date ;) wasn't really worth/needed for this high-level doc.

  Andrea


> 
> 							Thanx, Paul
> 
> > diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> > index 0d8d7ef131e9a..c1d913944ad8b 100644
> > --- a/Documentation/memory-barriers.txt
> > +++ b/Documentation/memory-barriers.txt
> > @@ -471,8 +471,7 @@ And a couple of implicit varieties:
> >       operations after the ACQUIRE operation will appear to happen after the
> >       ACQUIRE operation with respect to the other components of the system.
> >       ACQUIRE operations include LOCK operations and both smp_load_acquire()
> > -     and smp_cond_acquire() operations. The later builds the necessary ACQUIRE
> > -     semantics from relying on a control dependency and smp_rmb().
> > +     and smp_cond_load_acquire() operations.
> > 
> >       Memory operations that occur before an ACQUIRE operation may appear to
> >       happen after it completes.
> > -- 
> > 2.7.4
> > 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire()
  2018-07-11 15:53     ` Andrea Parri
@ 2018-07-11 16:11       ` Paul E. McKenney
  0 siblings, 0 replies; 6+ messages in thread
From: Paul E. McKenney @ 2018-07-11 16:11 UTC (permalink / raw)
  To: Andrea Parri
  Cc: linux-kernel, linux-arch, linux-doc, Alan Stern, Will Deacon,
	Peter Zijlstra, Boqun Feng, Nicholas Piggin, David Howells,
	Jade Alglave, Luc Maranget, Akira Yokosawa, Daniel Lustig,
	Jonathan Corbet

On Wed, Jul 11, 2018 at 05:53:55PM +0200, Andrea Parri wrote:
> On Wed, Jul 11, 2018 at 08:38:40AM -0700, Paul E. McKenney wrote:
> > On Wed, Jul 11, 2018 at 03:08:50PM +0200, Andrea Parri wrote:
> > > Amend commit 1f03e8d2919270 ("locking/barriers: Replace smp_cond_acquire()
> > > with smp_cond_load_acquire()") by updating the documentation accordingly.
> > > Also remove some obsolete information related to the implementation.
> > > 
> > > Signed-off-by: Andrea Parri <andrea.parri@amarulasolutions.com>
> > > Cc: Alan Stern <stern@rowland.harvard.edu>
> > > Cc: Will Deacon <will.deacon@arm.com>
> > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > Cc: Boqun Feng <boqun.feng@gmail.com>
> > > Cc: Nicholas Piggin <npiggin@gmail.com>
> > > Cc: David Howells <dhowells@redhat.com>
> > > Cc: Jade Alglave <j.alglave@ucl.ac.uk>
> > > Cc: Luc Maranget <luc.maranget@inria.fr>
> > > Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> > > Cc: Akira Yokosawa <akiyks@gmail.com>
> > > Cc: Daniel Lustig <dlustig@nvidia.com>
> > > Cc: Jonathan Corbet <corbet@lwn.net>
> > > ---
> > >  Documentation/memory-barriers.txt | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > I have queued this for further review, thank you!  Just to confirm,
> > the reason that the old passage was obsolete is because ARMv8 implements
> > smp_cond_load_acquire() as a straight acquire load, correct?
> 
> Thanks.  Yes; the generic code builds on a control dependency and an
> smp_acquire__after_ctrl_dep() (which defaults to smp_rmb()); but the
> required ordering on arm64 is given by (its) smp_load_acquire().
> 
> I thought that entering this level of details (and keeping it up-to-
> date ;) wasn't really worth/needed for this high-level doc.

Agreed!

							Thanx, Paul

>   Andrea
> 
> 
> > 
> > 							Thanx, Paul
> > 
> > > diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt
> > > index 0d8d7ef131e9a..c1d913944ad8b 100644
> > > --- a/Documentation/memory-barriers.txt
> > > +++ b/Documentation/memory-barriers.txt
> > > @@ -471,8 +471,7 @@ And a couple of implicit varieties:
> > >       operations after the ACQUIRE operation will appear to happen after the
> > >       ACQUIRE operation with respect to the other components of the system.
> > >       ACQUIRE operations include LOCK operations and both smp_load_acquire()
> > > -     and smp_cond_acquire() operations. The later builds the necessary ACQUIRE
> > > -     semantics from relying on a control dependency and smp_rmb().
> > > +     and smp_cond_load_acquire() operations.
> > > 
> > >       Memory operations that occur before an ACQUIRE operation may appear to
> > >       happen after it completes.
> > > -- 
> > > 2.7.4
> > > 
> > 
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-07-11 16:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 10:02 [PATCH] doc: Replace smp_cond_acquire() with smp_cond_load_acquire() Andrea Parri
2018-07-10 14:34 ` Andrea Parri
2018-07-11 13:08 ` Andrea Parri
2018-07-11 15:38   ` Paul E. McKenney
2018-07-11 15:53     ` Andrea Parri
2018-07-11 16:11       ` Paul E. McKenney

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).