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
17901790
17911791 map.m_len = sec_blks;
17921792 next_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 :
17941795 GET_SEC_FROM_SEG(sbi, overprovision_segments(sbi)))) {
17951796 f2fs_down_write(&sbi->gc_lock);
17961797 stat_inc_gc_call_count(sbi, FOREGROUND);
fs/f2fs/gc.h+1−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 #define LIMIT_BOOST_ZONED_GC 25 /* percentage over total user space of boosted gc for zoned devices */
3636 #define DEF_MIGRATION_WINDOW_GRANULARITY_ZONED 3
3737 #define BOOST_GC_MULTIPLE 5
38+#define ZONED_PIN_SEC_REQUIRED_COUNT 1
3839
3940 #define DEF_GC_FAILED_PINNED_FILES 2048
4041 #define MAX_GC_FAILED_PINNED_FILES USHRT_MAX
fs/f2fs/segment.c+2−1
@@ -3237,7 +3237,8 @@ retry: · 3236 unmodified lines
32373237
32383238 if (f2fs_sb_has_blkzoned(sbi) && err == -EAGAIN && gc_required) {
32393239 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);
32413242 f2fs_up_write(&sbi->gc_lock);
32423243
32433244 gc_required = false;