On Jun 27, 2011, at 19:53, David Miller wrote:
> I'm trying to find the part of the v8 manual that says there is
> a situation where we should use "stbar" and a "ldstub" to implement
> proper memory barriers. In particular I'm looking in Appendix J,
> "Programming with the memory models." Where is the description?
See J.7, and study why the store instructions are replaces by SWAP.
>
> Adding a ldstub here is going to be really expensive, on UltraSparc
> that can be 36+ cycles even on a cache hit.
Yes, synchronization in multi-CPU systems is expensive.
If it's really cheap, you're probably doing something wrong.
> Also, the more I think about it, the issue really is that one is
> trying to run v8 code on a v9 cpu.
Double no:
1. No, my primary concern is about v8 code running on multiprocessor
systems implementing the SPARC v8 architecture (LEON3 in particular)
2. No, a SPARCv8 compliant binary should run correctly on both
SPARCv8 and SPARCv9. The entire raison-d'ĂȘtre for the SPARC
architecture is so we can write code based on the architecture,
and have it run correctly on all implementations.
-Geert