[PATCH 0/2] mm: Improve mlock tracking for large folios

kirill@shutemov.name posted 2 patches 1 week, 6 days ago
There is a newer version of this series
mm/memory.c |  9 ++-------
mm/rmap.c   | 13 ++++---------
2 files changed, 6 insertions(+), 16 deletions(-)
[PATCH 0/2] mm: Improve mlock tracking for large folios
Posted by kirill@shutemov.name 1 week, 6 days ago
From: Kiryl Shutsemau <kas@kernel.org>

We do not mlock large folios on adding them to rmap deferring until
relaim. It leads to substantial undercount of Mlocked in /proc/meminfo.

This patchset improves the situation by mlocking large folios fully
mapped to the VMA.

Partially mapped large folios are still not accounted, but it brings
meminfo value closer to the truth and makes it useful.

Kiryl Shutsemau (2):
  mm/fault: Try to map the entire file folio in finish_fault()
  mm/rmap: Improve mlock tracking for large folios

 mm/memory.c |  9 ++-------
 mm/rmap.c   | 13 ++++---------
 2 files changed, 6 insertions(+), 16 deletions(-)

-- 
2.50.1
Re: [PATCH 0/2] mm: Improve mlock tracking for large folios
Posted by Lorenzo Stoakes 1 week, 6 days ago
On Thu, Sep 18, 2025 at 12:21:55PM +0100, kirill@shutemov.name wrote:
> From: Kiryl Shutsemau <kas@kernel.org>
>
> We do not mlock large folios on adding them to rmap deferring until
> relaim. It leads to substantial undercount of Mlocked in /proc/meminfo.
>
> This patchset improves the situation by mlocking large folios fully
> mapped to the VMA.
>
> Partially mapped large folios are still not accounted, but it brings
> meminfo value closer to the truth and makes it useful.
>
> Kiryl Shutsemau (2):
>   mm/fault: Try to map the entire file folio in finish_fault()

I feel like you need to speak more about this change in the cover letter.

>   mm/rmap: Improve mlock tracking for large folios
>
>  mm/memory.c |  9 ++-------
>  mm/rmap.c   | 13 ++++---------
>  2 files changed, 6 insertions(+), 16 deletions(-)
>
> --
> 2.50.1
>

FYI I compile tested each comit, mm self test tested blah blah + all
looking good. So just about Baolin's input really for 1/2.