Re: [PATCH 1/8] mm: munlock use follow_page

From: Hugh Dickins
Date: Tue Sep 08 2009 - 07:31:42 EST


On Tue, 8 Sep 2009, KAMEZAWA Hiroyuki wrote:
> On Mon, 7 Sep 2009 22:29:55 +0100 (BST)
> Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx> wrote:
> > void munlock_vma_pages_range(struct vm_area_struct *vma,
> > - unsigned long start, unsigned long end)
> > + unsigned long start, unsigned long end)
> > {
> > + unsigned long addr;
> > +
> > + lru_add_drain();
> > vma->vm_flags &= ~VM_LOCKED;
> > - __mlock_vma_pages_range(vma, start, end, 0);
> > +
> > + for (addr = start; addr < end; addr += PAGE_SIZE) {
> > + struct page *page = follow_page(vma, addr, FOLL_GET);
> > + if (page) {
> > + lock_page(page);
> > + if (page->mapping)
> > + munlock_vma_page(page);
>
> Could you add "please see __mlock_vma_pages_range() to see why" or some here ?

Why the test on page->mapping?
Right, I'll add some such comment on that.
Waiting a day or two to see what else comes up.

Thanks,
Hugh
--
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/