| From: |
| Hugh Dickins <hugh@veritas.com> |
| To: |
| Andrew Morton <akpm@osdl.org> |
| Subject: |
| [PATCH] rmap 29 VM_RESERVED safety |
| Date: |
| Sat, 8 May 2004 23:02:46 +0100 (BST) |
| Cc: |
| Andrea Arcangeli <andrea@suse.de>, <davidm@hpl.hp.com>,
<kraxel@bytesex.org>, <linux-kernel@vger.kernel.org> |
From: Andrea Arcangeli <andrea@suse.de>
Set VM_RESERVED in videobuf_mmap_mapper, to warn do_no_page and swapout
not to worry about its pages. Set VM_RESERVED in ia64_elf32_init, it
too provides an unusual nopage which might surprise higher level checks.
Future safety: they don't actually pose a problem in this current tree.
arch/ia64/ia32/binfmt_elf32.c | 2 +-
drivers/media/video/video-buf.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--- rmap28/arch/ia64/ia32/binfmt_elf32.c 2004-05-08 20:55:05.446550456 +0100
+++ rmap29/arch/ia64/ia32/binfmt_elf32.c 2004-05-08 20:55:27.517195208 +0100
@@ -78,7 +78,7 @@ ia64_elf32_init (struct pt_regs *regs)
vma->vm_start = IA32_GDT_OFFSET;
vma->vm_end = vma->vm_start + PAGE_SIZE;
vma->vm_page_prot = PAGE_SHARED;
- vma->vm_flags = VM_READ|VM_MAYREAD;
+ vma->vm_flags = VM_READ|VM_MAYREAD|VM_RESERVED;
vma->vm_ops = &ia32_shared_page_vm_ops;
down_write(¤t->mm->mmap_sem);
{
--- rmap28/drivers/media/video/video-buf.c 2004-04-04 03:38:43.000000000 +0100
+++ rmap29/drivers/media/video/video-buf.c 2004-05-08 20:55:27.519194904 +0100
@@ -1176,7 +1176,7 @@ int videobuf_mmap_mapper(struct vm_area_
map->end = vma->vm_end;
map->q = q;
vma->vm_ops = &videobuf_vm_ops;
- vma->vm_flags |= VM_DONTEXPAND;
+ vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED;
vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */
vma->vm_private_data = map;
dprintk(1,"mmap %p: %08lx-%08lx pgoff %08lx bufs %d-%d\n",
-
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/