paulus at samba.org
Wed May 22 16:01:34 EST 2002
Allen Curtis writes:
> I was wondering if anyone had a rule for the use of eieio or sync
> instructions? After reviewing some of the newer code, it appears that eieio
> is used fairly often (at least in some code), sync is hardly ever used. Is a
> consideration for use whether data is being manipulated on different buses?
> (that would be my assumption) I would assume that operations on the same bus
> would occur in the proper sequence.
Nope. Loads can (and sometimes do) go ahead of stores. Stores can go
ahead of loads as well in some circumstances, for example if the load
is non-cacheable and the store hits in the cache. In principle loads
can get reordered too. Reordering can happen in the processor's
load/store unit and/or in the PCI host bridge.
I assume you are mostly concerned with loads and stores to
noncacheable addresses (i.e. I/O devices). Non-cacheable stores don't
get reordered, and eieio acts as a barrier to make sure that all
noncacheable accesses before the eieio are done before any of the
noncacheable accesses after the eieio.
If you are concerned with cacheable accesses as well you start needing
to use sync - it orders all accesses. Unfortunately it is quite an
expensive operation since it synchronizes the execution pipeline as
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
More information about the Linuxppc-dev