summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim2014-03-19 06:17:21 +0100
committerJaegeuk Kim2014-03-20 14:10:10 +0100
commit58c410351eba3d24f741c85a0eb9eaf15c94047d (patch)
tree0d6f328aa1c7645a8ba92bc80c91cfd425ca3c91 /fs/f2fs
parentf2fs: add missing documentation for dir_level (diff)
downloadkernel-qcow2-linux-58c410351eba3d24f741c85a0eb9eaf15c94047d.tar.gz
kernel-qcow2-linux-58c410351eba3d24f741c85a0eb9eaf15c94047d.tar.xz
kernel-qcow2-linux-58c410351eba3d24f741c85a0eb9eaf15c94047d.zip
f2fs: change reclaim rate in percentage
It is more reasonable to determine the reclaiming rate of prefree segments according to the volume size, which is set to 5% by default. For example, if the volume is 128GB, the prefree segments are reclaimed when the number reaches to 6.4GB. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/segment.c3
-rw-r--r--fs/f2fs/segment.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 6c5a4f0218ca..e7ff23a536a4 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1758,7 +1758,8 @@ int build_segment_manager(struct f2fs_sb_info *sbi)
sm_info->ovp_segments = le32_to_cpu(ckpt->overprov_segment_count);
sm_info->main_segments = le32_to_cpu(raw_super->segment_count_main);
sm_info->ssa_blkaddr = le32_to_cpu(raw_super->ssa_blkaddr);
- sm_info->rec_prefree_segments = DEF_RECLAIM_PREFREE_SEGMENTS;
+ sm_info->rec_prefree_segments = sm_info->main_segments *
+ DEF_RECLAIM_PREFREE_SEGMENTS / 100;
sm_info->ipu_policy = F2FS_IPU_DISABLE;
sm_info->min_ipu_util = DEF_MIN_IPU_UTIL;
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 9fc46ee27bb8..7091204680f4 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -14,7 +14,7 @@
#define NULL_SEGNO ((unsigned int)(~0))
#define NULL_SECNO ((unsigned int)(~0))
-#define DEF_RECLAIM_PREFREE_SEGMENTS 100 /* 200MB of prefree segments */
+#define DEF_RECLAIM_PREFREE_SEGMENTS 5 /* 5% over total segments */
/* L: Logical segment # in volume, R: Relative segment # in main area */
#define GET_L2R_SEGNO(free_i, segno) (segno - free_i->start_segno)