On Tue, Apr 29, 2008 at 03:08:44PM +1000, Benjamin Herrenschmidt wrote: > > On Tue, 2008-04-29 at 07:00 +0200, Nick Piggin wrote: > > > > At this point, the spinlock is not guaranteed to have ordered the previous > > stores to initialize the pte page with the subsequent store to put it in the > > page tables. So another Linux page table walker might be walking down (without > > any locks, because we have split-leaf-ptls), and find that new pte we've > > inserted. It might try to take the spinlock before the store from the other > > CPU initializes it. And subsequently it might read a pte_t out before stores > > from the other CPU have cleared the memory. > > Funny, we used to have a similar race where the zeros for clearing a > newly allocated anonymous pages end up reaching the coherency domain > after the new PTE in set_pte, causing memory corruption on threaded > apps. I think back then we fixed that with an explicit smp_wmb() before > a set_pte(). Yep, I remember that one. We had the same problem with inserting pages into the pagecache radix-tree, so I recently changed the fix to encompass both problems: the barriers are now in SetPageUptodate and (Test)PageUptodate. > Maybe we need that also when setting the higher levels. That is my reading of the situation, yes. -- 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