aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-09-17 20:52:58 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-09-23 14:10:24 -0400
commit95dd89730119b97d82f9edc806757cef737703e5 (patch)
tree659e6547a14d2ab35db77e24564ccd6892398144 /fs
parent9b5f136fd41658f384a5b4ea49d8ef37036e15f5 (diff)
f2fs: use more free segments until SSR is activated
Previously, f2fs activates SSR if the # of free segments reaches to the # of overprovisioned segments. In this case, SSR starts to use dirty segments only, so that the overprovisoned space cannot be selected for new data. This means that we have no chance to utilizae the overprovisioned space at all. This patch fixes that by allowing LFS allocations until the # of free segments reaches to the last threshold, reserved space. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/segment.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index d317b61f83a5..4588545b3030 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -437,8 +437,10 @@ static inline int reserved_sections(struct f2fs_sb_info *sbi)
437 437
438static inline bool need_SSR(struct f2fs_sb_info *sbi) 438static inline bool need_SSR(struct f2fs_sb_info *sbi)
439{ 439{
440 return (prefree_segments(sbi) / sbi->segs_per_sec) 440 int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES);
441 + free_sections(sbi) < overprovision_sections(sbi); 441 int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS);
442 return free_sections(sbi) <= (node_secs + 2 * dent_secs +
443 reserved_sections(sbi) + 1);
442} 444}
443 445
444static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed) 446static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed)