Re: [PATCH v7 3/8] mm/rmap: Split try_to_munlock from try_to_unmap

From: Alistair Popple
Date: Tue Mar 30 2021 - 18:17:53 EST


On Wednesday, 31 March 2021 9:09:30 AM AEDT Alistair Popple wrote:
> On Wednesday, 31 March 2021 5:49:03 AM AEDT Jason Gunthorpe wrote:
> > On Fri, Mar 26, 2021 at 11:08:00AM +1100, Alistair Popple wrote:

<snip>

> > So what clears PG_mlocked on this call path?
>
> See munlock_vma_page(). munlock works by clearing PG_mlocked, then calling
> try_to_munlock to check if any VMAs still need it locked in which case
> PG_mlocked gets set again. There are no other callers of try_to_munlock().
>
> > Something needs attention here..
>
> I think the code is correct, but perhaps the naming could be better. Would be
> interested hearing any thoughts on renaming try_to_munlock() to try_to_mlock()
> as the current name appears based on the context it is called from (munlock)
> rather than what it does (mlock).

Actually Documentation/vm/unevictable-lru.rst contains a better suggestion:

try_to_munlock() Reverse Map Scan
---------------------------------

.. warning::
[!] TODO/FIXME: a better name might be page_mlocked() - analogous to the
page_referenced() reverse map walker.

Thoughts on renaming try_to_unlock() -> page_mlocked() and try_to_munlock_one() -> page_mlock_one()?

> - Alistair
>
> > Jason
> >
>
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>