[PATCH 0/6] mm, swap: clean up swap cache mapping helper

Kairui Song posted 6 patches 7 months, 3 weeks ago
There is a newer version of this series
fs/btrfs/extent_io.c    |  2 +-
fs/f2fs/data.c          |  4 ++--
fs/f2fs/inline.c        |  4 ++--
fs/f2fs/super.c         |  2 +-
fs/fuse/file.c          |  4 ++--
include/linux/pagemap.h | 29 ++++-------------------------
mm/memfd.c              |  1 +
mm/migrate.c            |  1 +
mm/swap.h               | 18 ++++++++++++++++++
mm/swapfile.c           | 15 ---------------
10 files changed, 32 insertions(+), 48 deletions(-)
[PATCH 0/6] mm, swap: clean up swap cache mapping helper
Posted by Kairui Song 7 months, 3 weeks ago
From: Kairui Song <kasong@tencent.com>

This series removes usage of folio_index usage in fs/, and remove swap
cache checking in folio_contains.

Currently, the swap cache is already no longer directly exposed to fs,
and swap cache will be more different from page cache. Clean up the
helpers first to simplify the code and eliminate the helpers used for
resolving circular header dependency issue between filemap and swap
headers.

Kairui Song (6):
  fuse: drop usage of folio_index
  btrfs: drop usage of folio_index
  f2fs: drop usage of folio_index
  filemap: do not use folio_contains for swap cache folios
  mm: move folio_index to mm/swap.h and remove no longer needed helper
  mm, swap: remove no longer used swap mapping helper

 fs/btrfs/extent_io.c    |  2 +-
 fs/f2fs/data.c          |  4 ++--
 fs/f2fs/inline.c        |  4 ++--
 fs/f2fs/super.c         |  2 +-
 fs/fuse/file.c          |  4 ++--
 include/linux/pagemap.h | 29 ++++-------------------------
 mm/memfd.c              |  1 +
 mm/migrate.c            |  1 +
 mm/swap.h               | 18 ++++++++++++++++++
 mm/swapfile.c           | 15 ---------------
 10 files changed, 32 insertions(+), 48 deletions(-)

-- 
2.49.0
Re: [PATCH 0/6] mm, swap: clean up swap cache mapping helper
Posted by Matthew Wilcox 7 months, 3 weeks ago
On Mon, Apr 28, 2025 at 02:59:02AM +0800, Kairui Song wrote:
> This series removes usage of folio_index usage in fs/, and remove swap
> cache checking in folio_contains.

Thanks.  I've been removing them as I've come across them (eg
fcd4904e2f69), but I haven't gone all out to try to remove it
from all filesystems.
Re: [PATCH 0/6] mm, swap: clean up swap cache mapping helper
Posted by Kairui Song 7 months, 3 weeks ago
On Mon, Apr 28, 2025 at 3:00 AM Kairui Song <ryncsn@gmail.com> wrote:
>
> From: Kairui Song <kasong@tencent.com>
>
> This series removes usage of folio_index usage in fs/, and remove swap
> cache checking in folio_contains.
>
> Currently, the swap cache is already no longer directly exposed to fs,
> and swap cache will be more different from page cache. Clean up the
> helpers first to simplify the code and eliminate the helpers used for
> resolving circular header dependency issue between filemap and swap
> headers.
>
> Kairui Song (6):
>   fuse: drop usage of folio_index
>   btrfs: drop usage of folio_index
>   f2fs: drop usage of folio_index
>   filemap: do not use folio_contains for swap cache folios
>   mm: move folio_index to mm/swap.h and remove no longer needed helper
>   mm, swap: remove no longer used swap mapping helper
>
>  fs/btrfs/extent_io.c    |  2 +-
>  fs/f2fs/data.c          |  4 ++--
>  fs/f2fs/inline.c        |  4 ++--
>  fs/f2fs/super.c         |  2 +-
>  fs/fuse/file.c          |  4 ++--
>  include/linux/pagemap.h | 29 ++++-------------------------
>  mm/memfd.c              |  1 +
>  mm/migrate.c            |  1 +
>  mm/swap.h               | 18 ++++++++++++++++++
>  mm/swapfile.c           | 15 ---------------
>  10 files changed, 32 insertions(+), 48 deletions(-)
>
> --
> 2.49.0
>

I just realized I added duplicated Sign-off-by in a few commits, sorry about it.