Re: [PATCH 6/24] make atomic_read() behave consistently on frv

Segher Boessenkool
2007-08-15T18:53:18Z

> Well if there is only one memory location involved, then smp_rmb()
> isn't
> going to really do anything anyway, so it would be incorrect to use it.

rmb() orders *any* two reads; that includes two reads from the same
location.

> Consider that smp_rmb basically will do anything from flushing the
> pipeline to invalidating loads speculatively executed out of order.
> AFAIK
> it will not control the visibility of stores coming from other CPUs
> (that
> is up to the cache coherency).

The writer side should typically use wmb() whenever the reader side
uses rmb(), sure.

Segher