History

f2fs: decrease spare area for pinned files for zoned devices

Now we reclaim too much space before allocating pinned space for zoned devices.

Daeho Jeong committed 2 years ago

Commit fa089721 parent 2d56b4e3 files · +5 −2Browse files

Unified · Split

3 files
  1. fs/f2fs/file.c +2 −1
  2. fs/f2fs/gc.h +1 −0
  3. fs/f2fs/segment.c +2 −1
fs/f2fs/file.c+2−1
@@ -1790,7 +1790,8 @@ static int f2fs_expand_inode_data(struct inode *inode, loff_t offset, · 1789 unmodified lines
1790 1790
1791 map.m_len = sec_blks;1791 map.m_len = sec_blks;
1792next_alloc:1792next_alloc:
1793 if (has_not_enough_free_secs(sbi, 0,1793 if (has_not_enough_free_secs(sbi, 0, f2fs_sb_has_blkzoned(sbi) ?
1794 ZONED_PIN_SEC_REQUIRED_COUNT :
1794 GET_SEC_FROM_SEG(sbi, overprovision_segments(sbi)))) {1795 GET_SEC_FROM_SEG(sbi, overprovision_segments(sbi)))) {
1795 f2fs_down_write(&sbi->gc_lock);1796 f2fs_down_write(&sbi->gc_lock);
1796 stat_inc_gc_call_count(sbi, FOREGROUND);1797 stat_inc_gc_call_count(sbi, FOREGROUND);
fs/f2fs/gc.h+1−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
35#define LIMIT_BOOST_ZONED_GC 25 /* percentage over total user space of boosted gc for zoned devices */35#define LIMIT_BOOST_ZONED_GC 25 /* percentage over total user space of boosted gc for zoned devices */
36#define DEF_MIGRATION_WINDOW_GRANULARITY_ZONED 336#define DEF_MIGRATION_WINDOW_GRANULARITY_ZONED 3
37#define BOOST_GC_MULTIPLE 537#define BOOST_GC_MULTIPLE 5
38#define ZONED_PIN_SEC_REQUIRED_COUNT 1
38 39
39#define DEF_GC_FAILED_PINNED_FILES 204840#define DEF_GC_FAILED_PINNED_FILES 2048
40#define MAX_GC_FAILED_PINNED_FILES USHRT_MAX41#define MAX_GC_FAILED_PINNED_FILES USHRT_MAX
fs/f2fs/segment.c+2−1
@@ -3237,7 +3237,8 @@ retry: · 3236 unmodified lines
3237 3237
3238 if (f2fs_sb_has_blkzoned(sbi) && err == -EAGAIN && gc_required) {3238 if (f2fs_sb_has_blkzoned(sbi) && err == -EAGAIN && gc_required) {
3239 f2fs_down_write(&sbi->gc_lock);3239 f2fs_down_write(&sbi->gc_lock);
3240 err = f2fs_gc_range(sbi, 0, GET_SEGNO(sbi, FDEV(0).end_blk), true, 1);3240 err = f2fs_gc_range(sbi, 0, GET_SEGNO(sbi, FDEV(0).end_blk),
3241 true, ZONED_PIN_SEC_REQUIRED_COUNT);
3241 f2fs_up_write(&sbi->gc_lock);3242 f2fs_up_write(&sbi->gc_lock);
3242 3243
3243 gc_required = false;3244 gc_required = false;