Re: fast path for anonymous memory allocation

From: Benjamin Herrenschmidt <>
Date: 2004-11-19 18:07:48
On Thu, 2004-11-18 at 19:28 -0800, Christoph Lameter wrote:
> On Fri, 19 Nov 2004, Nick Piggin wrote:
> > But you're doing it after you've set up a pte for that page you are
> > clearing... I think? What's to stop another thread trying to read or
> > write to it concurrently?
> Nothing. If this had led to anything then we would have needed to address
> this issue. The clearing had to be outside of the lock in order not to
> impact the performance tests negatively.

No, it's clearly a bug. We even had a very hard to track down bug
recently on ppc64 which was caused by the fact that set_pte didn't
contain a barrier, thus the stores done by the _previous_
clear_user_high_page() could be re-ordered with the store to the PTE.
That could cause another process to "see" the PTE before the writes of 0
to the page, and thus start writing to the page before all zero's went
in, thus ending up with corrupted data. We had a real life testcase of
this one. This test case would blow up right away with your code I

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to
More majordomo info at
Received on Fri Nov 19 02:12:55 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:32 EST