aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2018-07-25 12:11:56 +0900
committerJaegeuk Kim <jaegeuk@kernel.org>2018-08-20 23:13:42 -0700
commit6f8d4455060dfb0e32dfb8e685b97caf4ed1be41 (patch)
treea0fad8fa5e8f4efc35784e22f3427e65e751e2e8 /fs/f2fs/f2fs.h
parentf2fs: fix performance issue observed with multi-thread sequential read (diff)
downloadlinux-dev-6f8d4455060dfb0e32dfb8e685b97caf4ed1be41.tar.xz
linux-dev-6f8d4455060dfb0e32dfb8e685b97caf4ed1be41.zip
f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc
The f2fs_gc() called by f2fs_balance_fs() requires to be called outside of fi->i_gc_rwsem[WRITE], since f2fs_gc() can try to grab it in a loop. If it hits the miximum retrials in GC, let's give a chance to release gc_mutex for a short time in order not to go into live lock in the worst case. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 170573f8a04a..96bde026636f 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1243,6 +1243,7 @@ struct f2fs_sb_info {
unsigned int gc_mode; /* current GC state */
/* for skip statistic */
unsigned long long skipped_atomic_files[2]; /* FG_GC and BG_GC */
+ unsigned long long skipped_gc_rwsem; /* FG_GC only */
/* threshold for gc trials on pinned files */
u64 gc_pin_file_threshold;