Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-30 Thread Davidlohr Bueso
On Wed, 2015-04-29 at 21:44 +0200, Manfred Spraul wrote: > Hi Davidlohr, > > On 04/28/2015 06:59 PM, Davidlohr Bueso wrote: > > On Tue, 2015-04-28 at 18:43 +0200, Peter Zijlstra wrote: > >> Well, if you can 'guarantee' the cmpxchg will not fail, you can then > >> rely on the fact that cmpxchg impl

Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-29 Thread Manfred Spraul
Hi Davidlohr, On 04/28/2015 06:59 PM, Davidlohr Bueso wrote: On Tue, 2015-04-28 at 18:43 +0200, Peter Zijlstra wrote: Well, if you can 'guarantee' the cmpxchg will not fail, you can then rely on the fact that cmpxchg implies a full barrier, which would obviate the need for the wmb. Yes, assumi

Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-28 Thread Davidlohr Bueso
On Tue, 2015-04-28 at 18:43 +0200, Peter Zijlstra wrote: > Well, if you can 'guarantee' the cmpxchg will not fail, you can then > rely on the fact that cmpxchg implies a full barrier, which would > obviate the need for the wmb. Yes, assuming it implies barriers on both sides. And we could obviousl

Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-28 Thread Peter Zijlstra
On Tue, Apr 28, 2015 at 09:36:50AM -0700, Davidlohr Bueso wrote: > On Tue, 2015-04-28 at 14:37 +0200, Peter Zijlstra wrote: > > On Mon, Apr 27, 2015 at 08:24:53PM -0700, Davidlohr Bueso wrote: > > > +static inline void pipelined_send(struct wake_q_head *wake_q, > > > + str

Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-28 Thread Davidlohr Bueso
On Tue, 2015-04-28 at 14:37 +0200, Peter Zijlstra wrote: > On Mon, Apr 27, 2015 at 08:24:53PM -0700, Davidlohr Bueso wrote: > > +static inline void pipelined_send(struct wake_q_head *wake_q, > > + struct mqueue_inode_info *info, > > struct m

Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-28 Thread Peter Zijlstra
On Mon, Apr 27, 2015 at 08:24:53PM -0700, Davidlohr Bueso wrote: > +static inline void pipelined_send(struct wake_q_head *wake_q, > + struct mqueue_inode_info *info, > struct msg_msg *message, > struct ext

Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-27 Thread Davidlohr Bueso
On Fri, 2015-04-24 at 00:18 +0200, Thomas Gleixner wrote: > Can you please convert that over to Peters lockless wake queues so we > do not reimplement the same thing open coded here. So I'd like to include this in my v2 of the wake_q stuff, along with the futex conversion. What do you guys think o

Re: [PATCH v2] ipc/mqueue: remove STATE_PENDING

2015-04-23 Thread Thomas Gleixner
On Fri, 10 Apr 2015, Sebastian Andrzej Siewior wrote: > >And: please test it, too. (patch the kernel so that you can trigger > >this case). > > Why patch? Isn't this triggered if you have a reader waiting and you > send a message? Manfred referred to the exit race. Though you can spare that exerc