lkml.org 
[lkml]   [2003]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Fix mlockall for PROT_NONE mappings

On Thu, 9 Oct 2003, Andi Kleen wrote:
>
> Ok, here's a new version.

Still won't work.

You need to call mlock_fixup() to split the vma properly (it might not
cover the whole vma, and we _do_ want to keep track of the VM_LOCKED flag
correctly.

I _think_ the proper fix is something trivial like this, but it's
obviously untested. Please verify

Linus

----
--- 1.6/mm/mlock.c Sun Sep 21 14:50:36 2003
+++ edited/mm/mlock.c Thu Oct 9 08:39:25 2003
@@ -43,7 +43,8 @@
pages = (end - start) >> PAGE_SHIFT;
if (newflags & VM_LOCKED) {
pages = -pages;
- ret = make_pages_present(start, end);
+ if (newflags & VM_READ)
+ ret = make_pages_present(start, end);
}

vma->vm_mm->locked_vm -= pages;
-
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.039 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site