Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

f2fs: decrease spare area for pinned files for zoned devices

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

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Daeho Jeong and committed by
Jaegeuk Kim
fa08972b 2d56b4e3

+5 -2
+2 -1
fs/f2fs/file.c
··· 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);
+1
fs/f2fs/gc.h
··· 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
+2 -1
fs/f2fs/segment.c
··· 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;