Re: [patch] mm: recheck lock rlim after f_op->mmap() method

From: Hugh Dickins
Date: Tue Jul 10 2007 - 15:49:25 EST


On Tue, 10 Jul 2007, Dmitry Monakhov wrote:
> On 18:27 ÐÑÑ 10 ÐÑÐ , Hugh Dickins wrote:
> > 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).

Ah, then fglrx is wrong too. We don't want to check locked_vm,
but we don't much want it to wrap negative later. Perhaps we
should mask VM_LOCKED off, perhaps we should BUG, perhaps we
should ask ATI/AMD to change it (a BUG would be persuasive ;)

> BTW: where is comment about it in do_mmap_pgoff:

Sorry, I don't understand. You'd like a comment saying which flags
the driver may change and which it may not? Hmmm... not today.

> /* 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;

Hugh