Commit c34e333f authored by Jaegeuk Kim's avatar Jaegeuk Kim

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: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 749ebfd1
...@@ -453,7 +453,8 @@ static inline int reserved_sections(struct f2fs_sb_info *sbi) ...@@ -453,7 +453,8 @@ static inline int reserved_sections(struct f2fs_sb_info *sbi)
static inline bool need_SSR(struct f2fs_sb_info *sbi) static inline bool need_SSR(struct f2fs_sb_info *sbi)
{ {
return (free_sections(sbi) < overprovision_sections(sbi)); return ((prefree_segments(sbi) / sbi->segs_per_sec)
+ free_sections(sbi) < overprovision_sections(sbi));
} }
static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed) static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment