Re: wake_q memory ordering

2019-10-11 Thread Davidlohr Bueso
On Fri, 11 Oct 2019, Manfred Spraul wrote: I don't know. The new documentation would not have answered my question (is it ok to combine smp_mb__before_atomic() with atomic_relaxed()?). And it copies content already present in atomic_t.txt. Well, the _relaxed (and release/acquire) extentions

Re: wake_q memory ordering

2019-10-11 Thread Manfred Spraul
Hi Davidlohr, On 10/10/19 9:25 PM, Davidlohr Bueso wrote: On Thu, 10 Oct 2019, Peter Zijlstra wrote: On Thu, Oct 10, 2019 at 02:13:47PM +0200, Manfred Spraul wrote: Therefore smp_mb__{before,after}_atomic() may be combined with cmpxchg_relaxed, to form a full memory barrier, on all archs.

Re: wake_q memory ordering

2019-10-10 Thread Davidlohr Bueso
On Thu, 10 Oct 2019, Peter Zijlstra wrote: On Thu, Oct 10, 2019 at 02:13:47PM +0200, Manfred Spraul wrote: Hi Peter, On 10/10/19 1:42 PM, Peter Zijlstra wrote: > On Thu, Oct 10, 2019 at 12:41:11PM +0200, Manfred Spraul wrote: > > Hi, > > > > Waiman Long noticed that the memory barriers in

Re: wake_q memory ordering

2019-10-10 Thread Peter Zijlstra
On Thu, Oct 10, 2019 at 02:13:47PM +0200, Manfred Spraul wrote: > Hi Peter, > > On 10/10/19 1:42 PM, Peter Zijlstra wrote: > > On Thu, Oct 10, 2019 at 12:41:11PM +0200, Manfred Spraul wrote: > > > Hi, > > > > > > Waiman Long noticed that the memory barriers in sem_lock() are not really > > >

Re: wake_q memory ordering

2019-10-10 Thread Manfred Spraul
Hi Peter, On 10/10/19 1:42 PM, Peter Zijlstra wrote: On Thu, Oct 10, 2019 at 12:41:11PM +0200, Manfred Spraul wrote: Hi, Waiman Long noticed that the memory barriers in sem_lock() are not really documented, and while adding documentation, I ended up with one case where I'm not certain about

Re: wake_q memory ordering

2019-10-10 Thread Peter Zijlstra
On Thu, Oct 10, 2019 at 12:41:11PM +0200, Manfred Spraul wrote: > Hi, > > Waiman Long noticed that the memory barriers in sem_lock() are not really > documented, and while adding documentation, I ended up with one case where > I'm not certain about the wake_q code: > > Questions: > - Does

wake_q memory ordering

2019-10-10 Thread Manfred Spraul
Hi, Waiman Long noticed that the memory barriers in sem_lock() are not really documented, and while adding documentation, I ended up with one case where I'm not certain about the wake_q code: Questions: - Does smp_mb__before_atomic() + a (failed) cmpxchg_relaxed provide an   ordering