1 May 2008 02:29
Re: [rfc] data race in page table setup/walking?
On Wed, Apr 30, 2008 at 08:53:44AM -0700, Linus Torvalds wrote: > > > 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). Oh there needs to be a compiler barrier there. I was just saying... I don't actually think we care (whether or not I'm right). > 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(Continue reading)
RSS Feed