[RFC PATCH 0/3] f2fs: reduce zoned LFS memory by sharing SIT valid maps

'wallentx posted 3 patches 1 month ago
Documentation/filesystems/f2fs.rst |  11 +
fs/f2fs/checkpoint.c               |   4 +-
fs/f2fs/debug.c                    |  21 +-
fs/f2fs/f2fs.h                     |  22 ++
fs/f2fs/gc.c                       |  29 +-
fs/f2fs/segment.c                  | 436 ++++++++++++++++++++++++-----
fs/f2fs/segment.h                  |  31 +-
fs/f2fs/super.c                    |  25 ++
fs/f2fs/sysfs.c                    |   8 +-
9 files changed, 494 insertions(+), 93 deletions(-)
[RFC PATCH 0/3] f2fs: reduce zoned LFS memory by sharing SIT valid maps
Posted by 'wallentx 1 month ago
From: wallentx <william.allentx@gmail.com>

This series reduces SIT-related memory overhead on zoned F2FS.

For zoned devices, F2FS operates in LFS mode. In that configuration SSR
is not used, IPU is not allowed, and discard defaults to section
granularity. That leaves a large amount of per-segment SIT bitmap
storage representing segments that are trivially empty or trivially
full.

The core change lets empty and fully valid segments reuse shared
zero/full SIT valid maps, while active or partial segments keep private
maps.

The series is split as follows:

  - [1/3] prepare lockless cur_valid_map readers for later pointer
    replacement
  - [2/3] introduce shared zero/full SIT valid maps for zoned LFS, keep
    private maps only for active or partial segments, invalidate scanned
    SIT metadata pages after mount-time rebuild, and reject
    checkpoint=disable because its accounting model does not fit the
    collapsed shared-SIT representation
  - [3/3] add shared_sit_check/noshared_sit_check to make the remaining
    CONFIG_F2FS_CHECK_FS mirror overhead optional without changing the
    default behavior

On a test system with 43 HM-SMR zoned volumes (~550 TB total) and
CONFIG_F2FS_CHECK_FS=y, static F2FS memory on top of jaegeuk/f2fs dev
at 5f04e90eedd0 changed as follows:

  - current behavior: 58.91 GiB
  - patch 2: 27.70 GiB
  - patch 2 + patch 3 with noshared_sit_check: 12.10 GiB

The same design has also been exercised for several months on a kernel
based on v6.18 on the same host. This series has also been built,
booted, and measured on top of jaegeuk/f2fs dev at 5f04e90eedd0.

Feedback is especially welcome on:

  - the 3-way split
  - the checkpoint=disable restriction in shared-SIT mode
  - whether shared_sit_check/noshared_sit_check is the right interface
    for the remaining CHECK_FS mirror cost

wallentx (3):
  f2fs: prepare cur_valid_map for safe lockless access
  f2fs: reduce zoned LFS memory by sharing SIT valid maps
  f2fs: add mount option to disable shared SIT mirror checks

 Documentation/filesystems/f2fs.rst |  11 +
 fs/f2fs/checkpoint.c               |   4 +-
 fs/f2fs/debug.c                    |  21 +-
 fs/f2fs/f2fs.h                     |  22 ++
 fs/f2fs/gc.c                       |  29 +-
 fs/f2fs/segment.c                  | 436 ++++++++++++++++++++++++-----
 fs/f2fs/segment.h                  |  31 +-
 fs/f2fs/super.c                    |  25 ++
 fs/f2fs/sysfs.c                    |   8 +-
 9 files changed, 494 insertions(+), 93 deletions(-)

-- 
2.53.0