Messages in this thread | | | Date | Thu, 17 Apr 2014 11:50:47 -0400 (EDT) | From | Alan Stern <> | Subject | Re: question on read_barrier_depends |
| |
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) ? \ > > ((typeof(__tmp->type))__kfifo->data) : \ > > (__tmp->buf) \ > > )[__kfifo->out & __tmp->kfifo.mask]; \ > > smp_wmb(); \ > > __kfifo->out++; \ > > > > It looks like the smp_wmb() should really be smp_mb(), because it > > separates the _read_ for val from the _write_ of kfifo->out. > > But where is kfifo->out read at all?
It is read in kfifo_put(), inside the call to kfifo_is_full() -> kfifo_len().
Alan Stern
| |