Skip to content

Commit

Permalink
f2fs: use more free segments until SSR is activated
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jaegeuk Kim committed Sep 23, 2014
1 parent 9b5f136 commit 95dd897
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/f2fs/segment.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,10 @@ static inline int reserved_sections(struct f2fs_sb_info *sbi)

static inline bool need_SSR(struct f2fs_sb_info *sbi)
{
return (prefree_segments(sbi) / sbi->segs_per_sec)
+ free_sections(sbi) < overprovision_sections(sbi);
int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES);
int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS);
return free_sections(sbi) <= (node_secs + 2 * dent_secs +
reserved_sections(sbi) + 1);
}

static inline bool has_not_enough_free_secs(struct f2fs_sb_info *sbi, int freed)
Expand Down

0 comments on commit 95dd897

Please sign in to comment.