[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0707101813390.4717@blonde.wat.veritas.com>
Date: Tue, 10 Jul 2007 18:27:05 +0100 (BST)
From: Hugh Dickins <hugh@...itas.com>
To: Dmitry Monakhov <dmonakhov@...ru>
cc: Jes Sorensen <jes@....com>, linux-kernel@...r.kernel.org
Subject: Re: [patch] mm: recheck lock rlim after f_op->mmap() method
On Mon, 9 Jul 2007, Dmitry Monakhov wrote:
> Some device drivers can change vm_flags in their f_op->mmap
> method. In order to be on the safe side we have to recheck
> lock rlimit. Now we have to check lock rlimit from two places,
> let's move this common code to helper functon.
>
> Signed-off-by: Dmitry Monakhov <dmonakhov@...nvz.org>
> ---
> mm/mmap.c | 33 ++++++++++++++++++++++++++-------
> 1 files changed, 26 insertions(+), 7 deletions(-)
Or would this simpler patch be the right one? I suspect the
mspec driver only says VM_LOCKED because of a deep-seated but
irrational fear that its pages might fall into reclaim.
(I'd like to take out VM_RESERVED too, but that can always happen
another, indefinitely postponed time; there are others of those.)
Hugh
--- 2.6.22/drivers/char/mspec.c 2007-04-26 04:08:32.000000000 +0100
+++ linux/drivers/char/mspec.c 2007-07-10 18:12:11.000000000 +0100
@@ -265,7 +265,7 @@ mspec_mmap(struct file *file, struct vm_
vdata->refcnt = ATOMIC_INIT(1);
vma->vm_private_data = vdata;
- vma->vm_flags |= (VM_IO | VM_LOCKED | VM_RESERVED | VM_PFNMAP);
+ vma->vm_flags |= (VM_IO | VM_RESERVED | VM_PFNMAP);
if (vdata->type == MSPEC_FETCHOP || vdata->type == MSPEC_UNCACHED)
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
vma->vm_ops = &mspec_vm_ops;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists