On Wed, 30 Apr 2008, Nick Piggin wrote: > > Actually, aside, all those smp_wmb() things in pgtable-3level.h can > probably go away if we cared: because we could be sneaky and leverage > the assumption that top and bottom will always be in the same cacheline > and thus should be shielded from memory consistency problems :) Umm. Why would we care, since smp_wmb() is a no-op? (Yea, it's a compiler barrier, big deal, it's not going to cost us anything). Also, write barriers are not about cacheline access order, they tend to be more about the write *buffer*, ie before the write even hits the cache line. And a write coudl easily pass another write in the write buffer if there is (for example) a dependency on the address. So even if they are in the same cacheline, if the first write needs an offset addition, and the second one does not, it could easily be that the second one hits the write buffer first (together with some alias detection that re-does the things if they alias). Of course, on x86, the write ordering is strictly defined, and even if the CPU reorders writes they are guaranteed to never show up re-ordered, so this is not an issue. But I wanted to point out that memory ordering is *not* just about cachelines, and being in the same cacheline is no guarantee of anything, even if it can have *some* effects. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-arch" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html