lkml.org 
[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
Date

From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

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 <blaisorblade@yahoo.it>
---

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);
spin_lock(&mm->page_table_lock);
_
-
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: 2005-08-26 19:09    [W:0.025 / U:1.288 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site