lkml.org 
[lkml]   [2000]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Wiring down Pages
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/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.033 / U:22.580 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site