[lkml]   [2000]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
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


Hollywood goes for world dumbination,
Trailer at 11.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

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