Thank you for correcting me.
>
> That's why we can unlock early in the (very common) case of doing an new
> anonymous page: nobody is going to _add_ entries to the page tables
> without holding the mm semaphore, and the anonymous page case doesn't need
> the kernel lock for anything else either.
There seems to be another race: running do_anonymous_page outside the global
lock relies on put_page/set_pte being atomic.
set_pte is
#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
on i386. Nobody gurantees that gcc generates an atomic sequence for this
statement, also it needs a memory barrier to avoid SMP inconsisties.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/