[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20140529020443.974b0d1b.akpm@linux-foundation.org>
Date: Thu, 29 May 2014 02:04:43 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Konstantin Khlebnikov <koct9i@...il.com>
Cc: "linux-mm@...ck.org" <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: dont call mmu_notifier_invalidate_page during
munlock
On Thu, 29 May 2014 11:19:27 +0400 Konstantin Khlebnikov <koct9i@...il.com> wrote:
> On Thu, May 29, 2014 at 3:09 AM, Andrew Morton
> <akpm@...ux-foundation.org> wrote:
> > On Wed, 28 May 2014 11:59:55 +0400 Konstantin Khlebnikov <koct9i@...il.com> wrote:
> >
> >> try_to_munlock() searches other mlocked vmas, it never unmaps pages.
> >> There is no reason for invalidation because ptes are left unchanged.
> >>
> >> ...
> >>
> >> --- a/mm/rmap.c
> >> +++ b/mm/rmap.c
> >> @@ -1225,7 +1225,7 @@ int try_to_unmap_one(struct page *page, struct vm_area_struct *vma,
> >>
> >> out_unmap:
> >> pte_unmap_unlock(pte, ptl);
> >> - if (ret != SWAP_FAIL)
> >> + if (ret != SWAP_FAIL && TTU_ACTION(flags) != TTU_MUNLOCK)
> >> mmu_notifier_invalidate_page(mm, address);
> >> out:
> >> return ret;
> >
> > The patch itself looks reasonable but there is no such thing as
> > try_to_munlock(). I rewrote the changelog thusly:
>
> Wait, what? I do have function with this name in my sources. It calls rmap_walk
> with callback try_to_unmap_one and action TTU_MUNLOCK. This is the place
> where TTU_MUNLOCK is used, I've mentioned it as entry point of this logic.
Ah OK, I obviously misgrepped.
> >
> > : In its munmap mode, try_to_unmap_one() searches other mlocked vmas, it
> > : never unmaps pages. There is no reason for invalidation because ptes are
> > : left unchanged.
> >
> > Also, the name try_to_unmap_one() is now pretty inaccurate/incomplete.
> > Perhaps if someone is feeling enthusiastic they might think up a better
> > name for the various try_to_unmap functions and see if we can
> > appropriately document try_to_unmap_one().
>
> I thought about moving mlock part out of try_to_unmap_one() into
> separate function,
> but normal unmap needs this part too...
try_to_unmap_one() does appear to have enough in common with the
munlock operation to justify using common code. But doing so makes the
name wrong.
--
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