]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:42:13 +0000 (14:42 +0200)
commit876f57cc94922896cc71dd4696013a7c0558c9b4
tree8c3276c835dc1cfe3b86fd9359364fae89d704b6
parent938166b2b3051d9965c36f9b5228966d4f198b2a
f2fs: give priority to select unpinned section for foreground GC

[ Upstream commit 71419129625a50cfb5e3c5cc215948a3f98c806d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/gc.c
fs/f2fs/segment.c
fs/f2fs/segment.h