]> www.infradead.org Git - users/jedix/linux-maple.git/commit
f2fs: fix to shrink read extent node in batches
authorChao Yu <chao@kernel.org>
Thu, 21 Nov 2024 01:57:50 +0000 (09:57 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 21 Nov 2024 16:16:54 +0000 (16:16 +0000)
commit3fc5d5a182f6a1f8bd4dc775feb54c369dd2c343
tree018a2e518a0c38b1d9aa90260cc894eca42e3222
parent81520c684ca67aea6a589461a3caebb9b11dcc90
f2fs: fix to shrink read extent node in batches

We use rwlock to protect core structure data of extent tree during
its shrink, however, if there is a huge number of extent nodes in
extent tree, during shrink of extent tree, it may hold rwlock for
a very long time, which may trigger kernel hang issue.

This patch fixes to shrink read extent node in batches, so that,
critical region of the rwlock can be shrunk to avoid its extreme
long time hold.

Reported-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
Closes: https://lore.kernel.org/linux-f2fs-devel/20241112110627.1314632-1-xiuhong.wang@unisoc.com/
Signed-off-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/extent_cache.c