Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Peter Zijlstra
On Wed, Jun 01, 2016 at 03:07:14PM +0100, Will Deacon wrote: > On Wed, Jun 01, 2016 at 02:45:41PM +0200, Peter Zijlstra wrote: > > On Wed, Jun 01, 2016 at 01:13:33PM +0100, Will Deacon wrote: > > > On Wed, Jun 01, 2016 at 02:06:54PM +0200, Peter Zijlstra wrote: > > > > > > Works for me; but that

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Waiman Long
On 06/01/2016 05:31 AM, Peter Zijlstra wrote: On Tue, May 31, 2016 at 04:01:06PM -0400, Waiman Long wrote: You are doing two READ_ONCE's in the smp_cond_load_acquire loop. Can we change it to do just one READ_ONCE, like --- a/include/asm-generic/barrier.h +++ b/include/asm-generic/barrier.h @@

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Will Deacon
On Wed, Jun 01, 2016 at 02:45:41PM +0200, Peter Zijlstra wrote: > On Wed, Jun 01, 2016 at 01:13:33PM +0100, Will Deacon wrote: > > On Wed, Jun 01, 2016 at 02:06:54PM +0200, Peter Zijlstra wrote: > > > > Works for me; but that would loose using cmpwait() for > > > !smp_cond_load_acquire() spins,

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Peter Zijlstra
On Wed, Jun 01, 2016 at 01:13:33PM +0100, Will Deacon wrote: > On Wed, Jun 01, 2016 at 02:06:54PM +0200, Peter Zijlstra wrote: > > Works for me; but that would loose using cmpwait() for > > !smp_cond_load_acquire() spins, you fine with that? > > > > The two conversions in the patch were both

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Will Deacon
On Wed, Jun 01, 2016 at 02:06:54PM +0200, Peter Zijlstra wrote: > On Wed, Jun 01, 2016 at 01:00:10PM +0100, Will Deacon wrote: > > On Wed, Jun 01, 2016 at 11:31:58AM +0200, Peter Zijlstra wrote: > > > Will, since ARM64 seems to want to use this, does the below make sense > > > to you? > > > > Not

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Peter Zijlstra
On Wed, Jun 01, 2016 at 01:00:10PM +0100, Will Deacon wrote: > On Wed, Jun 01, 2016 at 11:31:58AM +0200, Peter Zijlstra wrote: > > Will, since ARM64 seems to want to use this, does the below make sense > > to you? > > Not especially -- I was going to override smp_cond_load_acquire anyway >

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Will Deacon
On Wed, Jun 01, 2016 at 11:31:58AM +0200, Peter Zijlstra wrote: > On Tue, May 31, 2016 at 04:01:06PM -0400, Waiman Long wrote: > > You are doing two READ_ONCE's in the smp_cond_load_acquire loop. Can we > > change it to do just one READ_ONCE, like > > > > --- a/include/asm-generic/barrier.h > >

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-06-01 Thread Peter Zijlstra
On Tue, May 31, 2016 at 04:01:06PM -0400, Waiman Long wrote: > You are doing two READ_ONCE's in the smp_cond_load_acquire loop. Can we > change it to do just one READ_ONCE, like > > --- a/include/asm-generic/barrier.h > +++ b/include/asm-generic/barrier.h > @@ -229,12 +229,18 @@ do { > * value;

Re: [PATCH -v3 7/8] locking: Move smp_cond_load_acquire() and friends into asm-generic/barrier.h

2016-05-31 Thread Waiman Long
On 05/31/2016 05:41 AM, Peter Zijlstra wrote: Since all asm/barrier.h should/must include asm-generic/barrier.h the latter is a good place for generic infrastructure like this. This also allows archs to override the new smp_acquire__after_ctrl_dep(). Signed-off-by: Peter Zijlstra