Re: question on read_barrier_depends

2014-04-21 Thread Alan Stern
On Mon, 21 Apr 2014, Oliver Neukum wrote: > > In addition, the following code in kfifo_get() does this: > > > > *(typeof(__tmp->type))__val = \ > > (__is_kfifo_ptr(__tmp) ? \ > > ((typeof(__tmp->type))__kfifo->data) : \ >

Re: question on read_barrier_depends

2014-04-21 Thread Oliver Neukum
On Wed, 2014-04-16 at 11:26 -0400, Alan Stern wrote: > On Wed, 16 Apr 2014, Oliver Neukum wrote: > > > Hi, > > > > I am looking at memory ordering and a question hit me. > > I was looking at the kfifo code. kfifo_put() has a barrier: > > > > )[__kfifo->in & __tmp->kfifo.mask]

Re: question on read_barrier_depends

2014-04-18 Thread Alan Stern
On Fri, 18 Apr 2014, Oliver Neukum wrote: > On Thu, 2014-04-17 at 11:50 -0400, Alan Stern wrote: > > On Thu, 17 Apr 2014, Oliver Neukum wrote: > > > > > On Wed, 2014-04-16 at 11:26 -0400, Alan Stern wrote: > > > > > > > In addition, the following code in kfifo_get() does this: > > > > > > > >

Re: question on read_barrier_depends

2014-04-18 Thread Oliver Neukum
On Thu, 2014-04-17 at 11:50 -0400, Alan Stern wrote: > On Thu, 17 Apr 2014, Oliver Neukum wrote: > > > On Wed, 2014-04-16 at 11:26 -0400, Alan Stern wrote: > > > > > In addition, the following code in kfifo_get() does this: > > > > > > *(typeof(__tmp->type))__val = \ > > >

Re: question on read_barrier_depends

2014-04-18 Thread Oliver Neukum
On Thu, 2014-04-17 at 11:50 -0400, Alan Stern wrote: > On Thu, 17 Apr 2014, Oliver Neukum wrote: > > > On Wed, 2014-04-16 at 11:26 -0400, Alan Stern wrote: > > > > > In addition, the following code in kfifo_get() does this: > > > > > > *(typeof(__tmp->type))__val = \ > > >

Re: question on read_barrier_depends

2014-04-17 Thread Alan Stern
On Thu, 17 Apr 2014, Oliver Neukum wrote: > On Wed, 2014-04-16 at 11:26 -0400, Alan Stern wrote: > > > In addition, the following code in kfifo_get() does this: > > > > *(typeof(__tmp->type))__val = \ > > (__is_kfifo_ptr(__tmp) ? \ > >

Re: question on read_barrier_depends

2014-04-17 Thread Oliver Neukum
On Wed, 2014-04-16 at 11:26 -0400, Alan Stern wrote: > In addition, the following code in kfifo_get() does this: > > *(typeof(__tmp->type))__val = \ > (__is_kfifo_ptr(__tmp) ? \ > ((typeof(__tmp->type))__kfifo->data

Re: question on read_barrier_depends

2014-04-16 Thread Alan Stern
On Wed, 16 Apr 2014, Oliver Neukum wrote: > Hi, > > I am looking at memory ordering and a question hit me. > I was looking at the kfifo code. kfifo_put() has a barrier: > > )[__kfifo->in & __tmp->kfifo.mask] = \ > (typeof(*__tmp->type))__val; \

question on read_barrier_depends

2014-04-16 Thread Oliver Neukum
Hi, I am looking at memory ordering and a question hit me. I was looking at the kfifo code. kfifo_put() has a barrier: )[__kfifo->in & __tmp->kfifo.mask] = \ (typeof(*__tmp->type))__val; \ smp_wmb(); \