Re: Lock the page

Daniel Phillips (phillips@bonn-fries.net)
Fri, 27 Jul 2001 14:56:21 +0200


On Friday 27 July 2001 04:55, hochakhung@netscape.net wrote:
> After getting a page from alloc_pages(mask, order), is it necessary
> to lock the page to prevent it from being swapped out? Can I assume
> that I already have exclusive access to the page? Can I assume that
> the page is free and no other kernel control paths would use it?

You alloced it, it's yours. You haven't entered it into any managed
structure like the page cache, it's not on a lru list so it won't be
scanned by reclaim, and no page table entry points at it (except for
the kernel's own linear mapping if it's not a highuser page) so
virtual scanning won't find it either.

--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/