Re: Wiring down Pages

From: Rik van Riel (riel@conectiva.com.br)
Date: Thu Dec 21 2000 - 15:46:33 EST


On Fri, 22 Dec 2000, Sourav Sen wrote:

> Suppose I want to wire-down( as they call in BSD ) a page
> in memory, how I go about doing that? (I guess by setting the
> PG_locked bit of the flags field in the struct page, I can do
> it, am I right?)

Linux simply uses page->count for this. By using the page->count,
multiple parts of the kernel can pin the same page in memory at
different times and unlock them at different times without any
locking/unlocking conflicts...

page_cache_get(page); <= increases page->count

<your critical stuff here>

page_cache_drop(page); <= removes your extra count

regards,

Rik

--
Hollywood goes for world dumbination,
	Trailer at 11.

http://www.surriel.com/ http://www.conectiva.com/ http://distro.conectiva.com.br/

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



This archive was generated by hypermail 2b29 : Sat Dec 23 2000 - 21:00:29 EST