Now we reclaim too much space before allocating pinned space for zoned devices.
Unified · Split
| @@ -1790,7 +1790,8 @@ static int f2fs_expand_inode_data(struct inode *inode, loff_t offset, · 1789 unmodified lines | ||
| 1790 | 1790 | |
| 1791 | 1791 | map.m_len = sec_blks; |
| 1792 | 1792 | 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 : | |
| 1794 | 1795 | GET_SEC_FROM_SEG(sbi, overprovision_segments(sbi)))) { |
| 1795 | 1796 | f2fs_down_write(&sbi->gc_lock); |
| 1796 | 1797 | stat_inc_gc_call_count(sbi, FOREGROUND); |
| @@ -35,6 +35,7 @@ · 34 unmodified lines | ||
| 35 | 35 | #define LIMIT_BOOST_ZONED_GC 25 /* percentage over total user space of boosted gc for zoned devices */ |
| 36 | 36 | #define DEF_MIGRATION_WINDOW_GRANULARITY_ZONED 3 |
| 37 | 37 | #define BOOST_GC_MULTIPLE 5 |
| 38 | +#define ZONED_PIN_SEC_REQUIRED_COUNT 1 | |
| 38 | 39 | |
| 39 | 40 | #define DEF_GC_FAILED_PINNED_FILES 2048 |
| 40 | 41 | #define MAX_GC_FAILED_PINNED_FILES USHRT_MAX |
| @@ -3237,7 +3237,8 @@ retry: · 3236 unmodified lines | ||
| 3237 | 3237 | |
| 3238 | 3238 | if (f2fs_sb_has_blkzoned(sbi) && err == -EAGAIN && gc_required) { |
| 3239 | 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 | 3242 | f2fs_up_write(&sbi->gc_lock); |
| 3242 | 3243 | |
| 3243 | 3244 | gc_required = false; |