From: Paolo 'Blaisorblade' Giarrusso <[EMAIL PROTECTED]>

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 <[EMAIL PROTECTED]>
---

 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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to