Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-12 Thread Boqun Feng
On Mon, Oct 12, 2015 at 08:46:21AM +0200, Peter Zijlstra wrote: > On Sun, Oct 11, 2015 at 06:25:20PM +0800, Boqun Feng wrote: > > On Sat, Oct 10, 2015 at 09:58:05AM +0800, Boqun Feng wrote: > > > Hi Peter, > > > > > > Sorry for replying late. > > > > > > On Thu, Oct 01, 2015 at 02:27:16PM +0200,

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-11 Thread Peter Zijlstra
On Sun, Oct 11, 2015 at 06:25:20PM +0800, Boqun Feng wrote: > On Sat, Oct 10, 2015 at 09:58:05AM +0800, Boqun Feng wrote: > > Hi Peter, > > > > Sorry for replying late. > > > > On Thu, Oct 01, 2015 at 02:27:16PM +0200, Peter Zijlstra wrote: > > > On Wed, Sep 16, 2015 at 11:49:33PM +0800, Boqun Fe

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-11 Thread Boqun Feng
On Sat, Oct 10, 2015 at 09:58:05AM +0800, Boqun Feng wrote: > Hi Peter, > > Sorry for replying late. > > On Thu, Oct 01, 2015 at 02:27:16PM +0200, Peter Zijlstra wrote: > > On Wed, Sep 16, 2015 at 11:49:33PM +0800, Boqun Feng wrote: > > > Unlike other atomic operation variants, cmpxchg{,64}_acqui

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-09 Thread Boqun Feng
Hi Peter, Sorry for replying late. On Thu, Oct 01, 2015 at 02:27:16PM +0200, Peter Zijlstra wrote: > On Wed, Sep 16, 2015 at 11:49:33PM +0800, Boqun Feng wrote: > > Unlike other atomic operation variants, cmpxchg{,64}_acquire and > > atomic{,64}_cmpxchg_acquire don't have acquire semantics if the

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-01 Thread Peter Zijlstra
On Thu, Oct 01, 2015 at 08:12:19AM -0700, Paul E. McKenney wrote: > What C11 does is to allow the developer to specify different orderings > on success and failure. But it is no harder to supply a barrier (if > needed) on the failure path, right? Quite right. -- To unsubscribe from this list: se

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-01 Thread Paul E. McKenney
On Thu, Oct 01, 2015 at 02:36:26PM +0200, Peter Zijlstra wrote: > On Thu, Oct 01, 2015 at 02:27:15PM +0200, Peter Zijlstra wrote: > > On Wed, Sep 16, 2015 at 11:49:33PM +0800, Boqun Feng wrote: > > > Unlike other atomic operation variants, cmpxchg{,64}_acquire and > > > atomic{,64}_cmpxchg_acquire

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-01 Thread Paul E. McKenney
On Thu, Oct 01, 2015 at 02:36:26PM +0200, Peter Zijlstra wrote: > On Thu, Oct 01, 2015 at 02:27:15PM +0200, Peter Zijlstra wrote: > > On Wed, Sep 16, 2015 at 11:49:33PM +0800, Boqun Feng wrote: > > > Unlike other atomic operation variants, cmpxchg{,64}_acquire and > > > atomic{,64}_cmpxchg_acquire

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-01 Thread Peter Zijlstra
On Thu, Oct 01, 2015 at 02:27:15PM +0200, Peter Zijlstra wrote: > On Wed, Sep 16, 2015 at 11:49:33PM +0800, Boqun Feng wrote: > > Unlike other atomic operation variants, cmpxchg{,64}_acquire and > > atomic{,64}_cmpxchg_acquire don't have acquire semantics if the cmp part > > fails, so we need to im

Re: [RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-10-01 Thread Peter Zijlstra
On Wed, Sep 16, 2015 at 11:49:33PM +0800, Boqun Feng wrote: > Unlike other atomic operation variants, cmpxchg{,64}_acquire and > atomic{,64}_cmpxchg_acquire don't have acquire semantics if the cmp part > fails, so we need to implement these using assembly. I think that is actually expected and doc

[RFC v2 5/7] powerpc: atomic: Implement cmpxchg{,64}_* and atomic{,64}_cmpxchg_* variants

2015-09-16 Thread Boqun Feng
Unlike other atomic operation variants, cmpxchg{,64}_acquire and atomic{,64}_cmpxchg_acquire don't have acquire semantics if the cmp part fails, so we need to implement these using assembly. Note cmpxchg{,64}_relaxed and atomic{,64}_cmpxchg_relaxed are not compiler barriers. Signed-off-by: Boqun