f2fs: give priority to select unpinned section for foreground GC
authorChao Yu <chao@kernel.org>
Fri, 6 May 2022 10:30:31 +0000 (18:30 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 6 May 2022 21:26:33 +0000 (14:26 -0700)
commit71419129625a50cfb5e3c5cc215948a3f98c806d
tree1c98cc9d1aa6447472d0f9eaa72237fccdb44a27
parent6b8beca0edd32075a769bfe4178ca00c0dcd22a9
f2fs: give priority to select unpinned section for foreground GC

Previously, during foreground GC, if victims contain data of pinned file,
it will fail migration of the data, and meanwhile i_gc_failures of that
pinned file may increase, and when it exceeds threshold, GC will unpin
the file, result in breaking pinfile's semantics.

In order to mitigate such condition, let's record and skip section which
has pinned file's data and give priority to select unpinned one.

Signed-off-by: Chao Yu <chao.yu@oppo.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/gc.c
fs/f2fs/segment.c
fs/f2fs/segment.h