Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-30 Thread Peter Zijlstra
On Fri, May 27, 2016 at 03:34:13PM -0400, Chris Metcalf wrote: > >Does TILE never speculate reads? Because in that case the control > >dependency already provides a full load->load,store barrier and you'd > >want smp_acquire__after_ctrl_dep() to be a barrier() instead of > >smp_rmb(). > > Yes,

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-30 Thread Peter Zijlstra
On Fri, May 27, 2016 at 03:34:13PM -0400, Chris Metcalf wrote: > >Does TILE never speculate reads? Because in that case the control > >dependency already provides a full load->load,store barrier and you'd > >want smp_acquire__after_ctrl_dep() to be a barrier() instead of > >smp_rmb(). > > Yes,

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Chris Metcalf
On 5/27/2016 5:05 AM, Peter Zijlstra wrote: On Thu, May 26, 2016 at 05:10:36PM -0400, Chris Metcalf wrote: On 5/26/2016 10:19 AM, Peter Zijlstra wrote: --- a/arch/tile/lib/spinlock_32.c +++ b/arch/tile/lib/spinlock_32.c @@ -72,10 +72,14 @@ void arch_spin_unlock_wait(arch_spinlock if

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Chris Metcalf
On 5/27/2016 5:05 AM, Peter Zijlstra wrote: On Thu, May 26, 2016 at 05:10:36PM -0400, Chris Metcalf wrote: On 5/26/2016 10:19 AM, Peter Zijlstra wrote: --- a/arch/tile/lib/spinlock_32.c +++ b/arch/tile/lib/spinlock_32.c @@ -72,10 +72,14 @@ void arch_spin_unlock_wait(arch_spinlock if

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Peter Zijlstra
On Thu, May 26, 2016 at 05:10:36PM -0400, Chris Metcalf wrote: > On 5/26/2016 10:19 AM, Peter Zijlstra wrote: > >--- a/arch/tile/lib/spinlock_32.c > >+++ b/arch/tile/lib/spinlock_32.c > >@@ -72,10 +72,14 @@ void arch_spin_unlock_wait(arch_spinlock > > if (next == curr) > > return;

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Peter Zijlstra
On Thu, May 26, 2016 at 05:10:36PM -0400, Chris Metcalf wrote: > On 5/26/2016 10:19 AM, Peter Zijlstra wrote: > >--- a/arch/tile/lib/spinlock_32.c > >+++ b/arch/tile/lib/spinlock_32.c > >@@ -72,10 +72,14 @@ void arch_spin_unlock_wait(arch_spinlock > > if (next == curr) > > return;

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Peter Zijlstra
On Fri, May 27, 2016 at 08:46:49AM +0200, Martin Schwidefsky wrote: > > This fixes a number of spin_unlock_wait() users that (not > > unreasonably) rely on this. > > All that is missing is an smp_rmb(), no? Indeed. > > --- a/arch/s390/include/asm/spinlock.h > > +++

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Peter Zijlstra
On Fri, May 27, 2016 at 08:46:49AM +0200, Martin Schwidefsky wrote: > > This fixes a number of spin_unlock_wait() users that (not > > unreasonably) rely on this. > > All that is missing is an smp_rmb(), no? Indeed. > > --- a/arch/s390/include/asm/spinlock.h > > +++

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Martin Schwidefsky
On Thu, 26 May 2016 16:19:26 +0200 Peter Zijlstra wrote: > This patch updates/fixes all spin_unlock_wait() implementations. > > The update is in semantics; where it previously was only a control > dependency, we now upgrade to a full load-acquire to match the >

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-27 Thread Martin Schwidefsky
On Thu, 26 May 2016 16:19:26 +0200 Peter Zijlstra wrote: > This patch updates/fixes all spin_unlock_wait() implementations. > > The update is in semantics; where it previously was only a control > dependency, we now upgrade to a full load-acquire to match the > store-release from the

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-26 Thread Chris Metcalf
On 5/26/2016 10:19 AM, Peter Zijlstra wrote: --- a/arch/tile/lib/spinlock_32.c +++ b/arch/tile/lib/spinlock_32.c @@ -72,10 +72,14 @@ void arch_spin_unlock_wait(arch_spinlock if (next == curr) return; + smp_rmb(); + /* Wait until the current locker has released

Re: [PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-26 Thread Chris Metcalf
On 5/26/2016 10:19 AM, Peter Zijlstra wrote: --- a/arch/tile/lib/spinlock_32.c +++ b/arch/tile/lib/spinlock_32.c @@ -72,10 +72,14 @@ void arch_spin_unlock_wait(arch_spinlock if (next == curr) return; + smp_rmb(); + /* Wait until the current locker has released

[PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-26 Thread Peter Zijlstra
This patch updates/fixes all spin_unlock_wait() implementations. The update is in semantics; where it previously was only a control dependency, we now upgrade to a full load-acquire to match the store-release from the spin_unlock() we waited on. This ensures that when spin_unlock_wait() returns,

[PATCH -v2 4/6] locking, arch: Update spin_unlock_wait()

2016-05-26 Thread Peter Zijlstra
This patch updates/fixes all spin_unlock_wait() implementations. The update is in semantics; where it previously was only a control dependency, we now upgrade to a full load-acquire to match the store-release from the spin_unlock() we waited on. This ensures that when spin_unlock_wait() returns,