Skip to content

Commit

Permalink
f2fs: trigger GC when there are prefree segments
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jaegeuk Kim committed Sep 3, 2013
1 parent 749ebfd commit c34e333
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/f2fs/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ static inline int reserved_sections(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)
Expand Down

0 comments on commit c34e333

Please sign in to comment.