Skip to contentSkip to conversation

better block swap batching and a different take on swap_ops v3

DISCUSSION Christoph Hellwig 1 participant 1 message Jul 6 Memory management

lore
Share & tools
lore
#0 lore raw

Hi all,

this series makes use of the swap_iocb for block as well so that it doesn't do inefficient single-bio I/O, and then rebases the swap_ops from Baoquan on top of the now very different method structure.

When running doing kernels builds, which is a workload that doesn't really do much THP anonymous memory it still gets 2x clustering for writeout and 1.2x for reading back swap in. The overall times do not actually change, though.

Changes since v2:
- rebased to 7.2-rc2
- rename swap_add_page to swap_add_folio
- rename SWAP_OPS_F_NOFS to SWAP_OPS_F_REQUIRE_NOFS and document it
- improve various commit logs
- spelling fixes

Changes since v1:
- drop the memcg accounting for fs backed swap as it can't really work as-is
- change the related refactoring to not create a bisection hazard or compile issue with the wrong set of cgroup config options enabled
- remove a now dead function

Diffstat:

 Documentation/filesystems/locking.rst     |    5 
 Documentation/filesystems/vfs.rst         |    4 
 drivers/gpu/drm/i915/gem/i915_gem_shmem.c |    2 
 drivers/gpu/drm/ttm/ttm_backup.c          |    2 
 fs/nfs/file.c                             |    4 
 fs/smb/client/file.c                      |    4 
 include/linux/shmem_fs.h                  |    5 
 include/linux/swap.h                      |    7 
 include/linux/vm_event_item.h             |    4 
 mm/madvise.c                              |   16 
 mm/page_io.c                              |  585 ++++++++++++++----------------
 mm/shmem.c                                |   18 
 mm/swap.h                                 |   67 +--
 mm/swap_state.c                           |   53 +-
 mm/swapfile.c                             |   11 
 mm/vmscan.c                               |   30 -
 mm/vmstat.c                               |    6 
 mm/zswap.c                                |    4 
 18 files changed, 431 insertions(+), 396 deletions(-)