diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-09-02 20:46:45 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-09-02 21:11:20 -0400 |
commit | c34e333fd5ca41317c3dab69ed8a212acacd4aeb (patch) | |
tree | 4f217cb37d08e522808303392bdf4ce84fa20bb2 /fs | |
parent | 749ebfd174bd6fca3083da5f1e7933cbd60316c9 (diff) |
f2fs: trigger GC when there are prefree segments
Previously, f2fs conducts SSR when free_sections() < overprovision_sections.
But, even though there are a lot of prefree segments, it can consider SSR only.
So, let's consider the number of prefree segments too for triggering SSR.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/segment.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index 062424a0e4c3..cd9bd93212ad 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h | |||
@@ -453,7 +453,8 @@ static inline int reserved_sections(struct f2fs_sb_info *sbi) | |||
453 | 453 | ||
454 | static inline bool need_SSR(struct f2fs_sb_info *sbi) | 454 | static inline bool need_SSR(struct f2fs_sb_info *sbi) |
455 | { | 455 | { |
456 | return (free_sections(sbi) < overprovision_sections(sbi)); | 456 | return ((prefree_segments(sbi) / sbi->segs_per_sec) |
457 | + free_sections(sbi) < overprovision_sections(sbi)); | ||
457 | } | 458 | } |
458 | 459 | ||
459 | static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed) | 460 | static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed) |