perf events ring buffer memory barrier on powerpc

Victor Kaplansky VICTORK at il.ibm.com
Thu Oct 31 23:55:25 EST 2013


"David Laight" <David.Laight at aculab.com> wrote on 10/31/2013 02:28:56 PM:

> So even though the wmb() in the writer ensures the writes are correctly
> ordered, the reader can read the old value from the second location from
> its local cache.

In case of circular buffer, the only thing that producer reads is @tail,
and nothing wrong will happen if producer reads old value of @tail.
Moreover,
adherents of smp_mb() insert it *after* the read of @tail, so it cannot
prevent reading of old value anyway.
-- Victor



More information about the Linuxppc-dev mailing list