lkml.org 
[lkml]   [2004]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] restore protections after forced fault in get_user_pages


On Mon, 2 Feb 2004, Roland McGrath wrote:
>
> It would be ideal. However, it would also require changing the interfaces
> further. Currently handle_mm_fault just says what happened, and doesn't
> give back the page directly. get_user_pages then retakes
> mm->page_table_lock and calls follow_page to look up the page.

I'd suggest making this be:
- handle_mm_fault() take a more detailed flag ("read / write / copy",
where the new "copy" part is a write that actually leaves the page
only readable, but marks it dirty)
- we do "follow-page" with a read.

That should be sufficient, I think: since "handle_mm_fault()" marks the
page dirty (but not writable) and will have done all the work to do a COW,
we know that once we do the "follow_page()", we'll be getting a private
copy. Which is what we wanted.

So only "handle_mm_fault()" would actually need changing.

I think.

Anybody see any problems with this approach?

Linus
-
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/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.641 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site