[PATCH 0/2] mm/mincore: minor clean up for swap cache checking

Kairui Song posted 2 patches 1 month, 3 weeks ago
mm/mincore.c    | 70 +++++++++++++++++++++++++++++++++++--------------
mm/swap.h       | 10 -------
mm/swap_state.c | 38 ---------------------------
3 files changed, 51 insertions(+), 67 deletions(-)
[PATCH 0/2] mm/mincore: minor clean up for swap cache checking
Posted by Kairui Song 1 month, 3 weeks ago
From: Kairui Song <kasong@tencent.com>

This series cleans up a swap cache helper only used by mincore, move it
back into mincore code. Also separate the swap cache related logics out
of shmem / page cache logics in mincore.

With this series we have less lines of code and better performance.

Before this series:
mincore on a swaped out 16G anon mmap range:
Took 488220 us
mincore on 16G shmem mmap range:
Took 530272 us.

After this series:
mincore on a swaped out 16G anon mmap range:
Took 446763 us
mincore on 16G shmem mmap range:
Took 460496 us.

About ~10% faster.

Kairui Song (2):
  mm/mincore, swap: consolidate swap cache checking for mincore
  mm/mincore: use a helper for checking the swap cache

 mm/mincore.c    | 70 +++++++++++++++++++++++++++++++++++--------------
 mm/swap.h       | 10 -------
 mm/swap_state.c | 38 ---------------------------
 3 files changed, 51 insertions(+), 67 deletions(-)

---

Changelog:
- Remove RFC prefix.
- Don't touch the PTL for now [ Jann Horn, David Hildenbrand ]
- Fix error check for filemap_get_folio [ Nhat Pham ]

RFC: https://lore.kernel.org/linux-mm/20250807152720.62032-1-ryncsn@gmail.com/

-- 
2.50.1