> On Sat, Jun 28, 2008 at 06:07:57PM -0400, John David Anglin wrote: > > There are two reasons to expose the memory *a in the asm: > > > > 1) To prevent the compiler from discarding a preceeding write to *a, and > > 2) to prevent it from caching *a in a register over the asm. > > Do either of those scenarios apply, given that every usage of this is > preceded by an asm clobbering memory? Probably not, I was just concerned about the correctness of the __ldcw() macro itself. I think the use of the macro should be confined to small inline functions to try to limit the effect of clobbering memory on GCC's optimization of loads and stores. > I believe the correct thing to do is to take out the two mb()s in the > various spin_lock routines and make the __ldcw() macro itself clobber > memory. This seems reasonable if you want __ldcw() to be a memory barrier. Dave -- J. David Anglin dave.anglin@xxxxxxxxxxxxxx National Research Council of Canada (613) 990-0752 (FAX: 952-6602) -- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html