Re: fast path for anonymous memory allocation

Christoph Lameter
2004-11-19T02:38:47Z

On Fri, 19 Nov 2004, Nick Piggin wrote:

> Ahh, you're doing clear_user_highpage after the pte is already set up?

The huge page code also has that optimization. Clearing of pages
may take some time which is one reason the kernel drops the page table
lock for anonymous page allocation and then reacquires it. The patch does
not relinquish the lock on the fast path thus the move outside of the
lock.

> Won't that be racy? I guess that would be an advantage of my approach,
> the clear_user_highpage can be done first (although that is more likely
> to be wasteful of cache).

If you do the clearing with the page table lock held then performance will
suffer.