lkml.org 
[lkml]   [1999]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: locking user memory and kiobuf
Date
Juan Gonzalez wrote:
>
> 3. Alternatively, can I directly manipulate the PG_locked flag for the
> pages in question?

From mm.h:

* During disk I/O, PG_locked is used. This bit is set before I/O
* and reset when I/O completes. page->wait is a wait queue of all
* tasks waiting for the I/O on this page to complete.

You probably want to use mem_map_inc_count() instead - you're not locking
the page for I/O. (e.g. you're not waking up page->wait when you're
done)

Note that Linus has sworn that he won't accept any drivers into the
kernel source which manipulate page tables, so those of us who do this
need to get together and feed some fixes to Stephen Tweedie. (jeez, you
guys seem to be coming out of the woodwork. A couple of months ago it
seemed like I was the only one with these problems.)

> For example, I could ensure the page(s) are in physical memory by
> accessing a word in that page (copy_to_user)

Yup, you need this to force COW pages, as the routine in memory.c to
do this isn't exported. Get Stephen's rawio patch and read it, and things
will become much clearer.

--
............................................................................
Peter Desnoyers
162 Pleasant St. (617) 661-1979 pjd@fred.cambridge.ma.us
Cambridge, Mass. 02139 (978) 461-0402 (work) pjd@giga-net.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site