Re: [patch] mm: recheck lock rlim after f_op->mmap() method
From: Dmitry Monakhov
Date: Tue Jul 10 2007 - 13:54:00 EST
On 18:27 ÐÑÑ 10 ÐÑÐ , Hugh Dickins wrote:
> 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@xxxxxxxxxx>
> > ---
> > 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.
No mspec is not the only one :( , in my case it was fglrx (ati driver).
BTW: where is comment about it in do_mmap_pgoff:
/* Can addr have changed??
*
* Answer: Yes, several device drivers can do
* it in their
* f_op->mmap method. -DaveM
*/
addr = vma->vm_start;
pgoff = vma->vm_pgoff;
vm_flags = vma->vm_flags;
>
> (I'd like to take out VM_RESERVED too, but that can always happen
> another, indefinitely postponed time; there are others of those.)
>
> Hugh
[skip]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/