diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-19 01:17:21 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-20 09:10:10 -0400 |
commit | 58c410351eba3d24f741c85a0eb9eaf15c94047d (patch) | |
tree | 0d6f328aa1c7645a8ba92bc80c91cfd425ca3c91 /fs | |
parent | 9179682591c231cc77840d4e75929cc1fa573365 (diff) |
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')
-rw-r--r-- | fs/f2fs/segment.c | 3 | ||||
-rw-r--r-- | fs/f2fs/segment.h | 2 |
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) | |||
1758 | sm_info->ovp_segments = le32_to_cpu(ckpt->overprov_segment_count); | 1758 | sm_info->ovp_segments = le32_to_cpu(ckpt->overprov_segment_count); |
1759 | sm_info->main_segments = le32_to_cpu(raw_super->segment_count_main); | 1759 | sm_info->main_segments = le32_to_cpu(raw_super->segment_count_main); |
1760 | sm_info->ssa_blkaddr = le32_to_cpu(raw_super->ssa_blkaddr); | 1760 | sm_info->ssa_blkaddr = le32_to_cpu(raw_super->ssa_blkaddr); |
1761 | sm_info->rec_prefree_segments = DEF_RECLAIM_PREFREE_SEGMENTS; | 1761 | sm_info->rec_prefree_segments = sm_info->main_segments * |
1762 | DEF_RECLAIM_PREFREE_SEGMENTS / 100; | ||
1762 | sm_info->ipu_policy = F2FS_IPU_DISABLE; | 1763 | sm_info->ipu_policy = F2FS_IPU_DISABLE; |
1763 | sm_info->min_ipu_util = DEF_MIN_IPU_UTIL; | 1764 | sm_info->min_ipu_util = DEF_MIN_IPU_UTIL; |
1764 | 1765 | ||
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 @@ | |||
14 | #define NULL_SEGNO ((unsigned int)(~0)) | 14 | #define NULL_SEGNO ((unsigned int)(~0)) |
15 | #define NULL_SECNO ((unsigned int)(~0)) | 15 | #define NULL_SECNO ((unsigned int)(~0)) |
16 | 16 | ||
17 | #define DEF_RECLAIM_PREFREE_SEGMENTS 100 /* 200MB of prefree segments */ | 17 | #define DEF_RECLAIM_PREFREE_SEGMENTS 5 /* 5% over total segments */ |
18 | 18 | ||
19 | /* L: Logical segment # in volume, R: Relative segment # in main area */ | 19 | /* L: Logical segment # in volume, R: Relative segment # in main area */ |
20 | #define GET_L2R_SEGNO(free_i, segno) (segno - free_i->start_segno) | 20 | #define GET_L2R_SEGNO(free_i, segno) (segno - free_i->start_segno) |