[lkml]   [2005]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 03/18] remap_file_pages protection support: make mprotect skip pagetables on nonuniform

From: Paolo 'Blaisorblade' Giarrusso <>

There is IMHO no reason to support using mprotect on non-uniform VMAs. The
only exception is to change the VMA's default protection (which is used for
non-individually remapped pages), but it must still ignore the page tables, as
done in this patch.

The only unsatisfied need is if I want to change protections without changing
the indexes, which with remap_file_pages you must do one page at a time and
re-specifying the indexes.

It is more reasonable to allow remap_file_pages to change protections on a PTE
range without changing the offsets. I've not implemented this, but if wanted I
can. For sure, UML doesn't currently need this interface.

However, for now I've implemented only this change to mprotect(), I'd like to
get some feedback about this choice.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <>

linux-2.6.git-paolo/mm/mprotect.c | 3 +++
1 files changed, 3 insertions(+)

diff -puN mm/mprotect.c~rfp-mprotect-skip-pagetables-on-nonuniform mm/mprotect.c
--- linux-2.6.git/mm/mprotect.c~rfp-mprotect-skip-pagetables-on-nonuniform 2005-08-17 13:36:43.000000000 +0200
+++ linux-2.6.git-paolo/mm/mprotect.c 2005-08-17 13:36:43.000000000 +0200
@@ -86,6 +86,9 @@ static void change_protection(struct vm_
unsigned long start = addr;

BUG_ON(addr >= end);
+ if (vma->vm_flags & VM_NONUNIFORM)
+ return;
pgd = pgd_offset(mm, addr);
flush_cache_range(vma, addr, end);
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-08-26 19:09    [W:0.046 / U:43.008 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site