summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-07-13 18:23:35 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-07-15 15:21:21 -0700
commit44a83499dda714d9262a9bf4fdac8c077893c9e6 (patch)
treec81bc6c47a133910f3e7d79a3a6e86b4bcbbcee7 /fs/f2fs/segment.c
parent5f281fab9b9a30073616c5e25da2111dec2fe482 (diff)
downloadop-kernel-dev-44a83499dda714d9262a9bf4fdac8c077893c9e6.zip
op-kernel-dev-44a83499dda714d9262a9bf4fdac8c077893c9e6.tar.gz
f2fs: add maximum prefree segments
In 1TB storage, we need to admit 22841 prefree segments, which can consume too much segments. This patch sets 8GB in max. prefree segments in that case. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 08f6c0b..e87aa05 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2409,6 +2409,9 @@ int build_segment_manager(struct f2fs_sb_info *sbi)
sm_info->ssa_blkaddr = le32_to_cpu(raw_super->ssa_blkaddr);
sm_info->rec_prefree_segments = sm_info->main_segments *
DEF_RECLAIM_PREFREE_SEGMENTS / 100;
+ if (sm_info->rec_prefree_segments > DEF_MAX_RECLAIM_PREFREE_SEGMENTS)
+ sm_info->rec_prefree_segments = DEF_MAX_RECLAIM_PREFREE_SEGMENTS;
+
if (!test_opt(sbi, LFS))
sm_info->ipu_policy = 1 << F2FS_IPU_FSYNC;
sm_info->min_ipu_util = DEF_MIN_IPU_UTIL;
OpenPOWER on IntegriCloud