Re: [PATCH 3/6] ipc/mqueue.c: Update/document memory barriers

2019-10-14 Thread Manfred Spraul
Hi Peter, On 10/14/19 3:58 PM, Peter Zijlstra wrote: On Mon, Oct 14, 2019 at 02:59:11PM +0200, Peter Zijlstra wrote: On Sat, Oct 12, 2019 at 07:49:55AM +0200, Manfred Spraul wrote: for (;;) { + /* memory barrier not required, we hold info->lock */ __set_c

Re: [PATCH 3/6] ipc/mqueue.c: Update/document memory barriers

2019-10-14 Thread Peter Zijlstra
On Mon, Oct 14, 2019 at 02:59:11PM +0200, Peter Zijlstra wrote: > On Sat, Oct 12, 2019 at 07:49:55AM +0200, Manfred Spraul wrote: > > > for (;;) { > > + /* memory barrier not required, we hold info->lock */ > > __set_current_state(TASK_INTERRUPTIBLE); > > > >

Re: [PATCH 3/6] ipc/mqueue.c: Update/document memory barriers

2019-10-14 Thread Peter Zijlstra
On Sat, Oct 12, 2019 at 07:49:55AM +0200, Manfred Spraul wrote: > for (;;) { > + /* memory barrier not required, we hold info->lock */ > __set_current_state(TASK_INTERRUPTIBLE); > > spin_unlock(&info->lock); > time = schedule_hrtimeout_

Re: [PATCH 3/6] ipc/mqueue.c: Update/document memory barriers

2019-10-13 Thread Davidlohr Bueso
On Sat, 12 Oct 2019, Manfred Spraul wrote: Update and document memory barriers for mqueue.c: - ewp->state is read without any locks, thus READ_ONCE is required. - add smp_aquire__after_ctrl_dep() after the READ_ONCE, we need acquire semantics if the value is STATE_READY. - add an explicit mem

[PATCH 3/6] ipc/mqueue.c: Update/document memory barriers

2019-10-11 Thread Manfred Spraul
Update and document memory barriers for mqueue.c: - ewp->state is read without any locks, thus READ_ONCE is required. - add smp_aquire__after_ctrl_dep() after the READ_ONCE, we need acquire semantics if the value is STATE_READY. - add an explicit memory barrier to __pipelined_op(), the refcou