]> git.ipfire.org Git - thirdparty/linux.git/commit
f2fs: Add bggc_io_aware to adjust the priority of BG_GC when issuing IO
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Fri, 8 Aug 2025 09:48:01 +0000 (17:48 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 20 Aug 2025 17:44:10 +0000 (17:44 +0000)
commit00798cd24f014fe55cbcdfeac4bab19ad6cd2bcb
treec1442459af08edd035c580b4abda67c3539a4d19
parent80b6d1d2535a343e43d658777a46f1ebce8f3413
f2fs: Add bggc_io_aware to adjust the priority of BG_GC when issuing IO

Currently, we have encountered some issues while testing ZUFS. In
situations near the storage limit (e.g., 50GB remaining), and after
simulating fragmentation by repeatedly writing and deleting data, we found
that application installation and startup tests conducted after idling for
a few minutes take significantly longer several times that of traditional
UFS. Tracing the operations revealed that the majority of I/Os were issued
by background GC, which blocks normal I/O operations.

Under normal circumstances, ZUFS indeed requires more background GC and
employs a more aggressive GC strategy. However, I aim to find a way to
minimize the impact on regular I/O operations under these near-limit
conditions. To address this, I have introduced a bggc_io_aware feature,
which controls the prioritization of background GC in the presence of I/Os.
This switch can be adjusted at the framework level to implement different
strategies. If set to AWARE_ALL_IO, all background GC operations will be
skipped during active I/O issuance. The default option remains consistent
with the current strategy, ensuring no change in behavior.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Documentation/ABI/testing/sysfs-fs-f2fs
fs/f2fs/f2fs.h
fs/f2fs/super.c
fs/f2fs/sysfs.c