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

f2fs: export migration_granularity sysfs entry

Add one sysfs entry to control migration granularity of GC in large
section f2fs, it can be tuned to mitigate heavy overhead of migrating
huge number of blocks in large section.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

authored by

Chao Yu and committed by
Jaegeuk Kim
34655575 e3080b01

+16
+9
Documentation/ABI/testing/sysfs-fs-f2fs
··· 92 92 Description: 93 93 Controls the number of trials to find a victim segment. 94 94 95 + What: /sys/fs/f2fs/<disk>/migration_granularity 96 + Date: October 2018 97 + Contact: "Chao Yu" <yuchao0@huawei.com> 98 + Description: 99 + Controls migration granularity of garbage collection on large 100 + section, it can let GC move partial segment{s} of one section 101 + in one GC cycle, so that dispersing heavy overhead GC to 102 + multiple lightweight one. 103 + 95 104 What: /sys/fs/f2fs/<disk>/dir_level 96 105 Date: March 2014 97 106 Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
+7
fs/f2fs/sysfs.c
··· 246 246 return count; 247 247 } 248 248 249 + if (!strcmp(a->attr.name, "migration_granularity")) { 250 + if (t == 0 || t > sbi->segs_per_sec) 251 + return -EINVAL; 252 + } 253 + 249 254 if (!strcmp(a->attr.name, "trim_sections")) 250 255 return -EINVAL; 251 256 ··· 411 406 F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, ra_nid_pages, ra_nid_pages); 412 407 F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, dirty_nats_ratio, dirty_nats_ratio); 413 408 F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, max_victim_search, max_victim_search); 409 + F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, migration_granularity, migration_granularity); 414 410 F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, dir_level, dir_level); 415 411 F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, cp_interval, interval_time[CP_TIME]); 416 412 F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, idle_interval, interval_time[REQ_TIME]); ··· 466 460 ATTR_LIST(min_hot_blocks), 467 461 ATTR_LIST(min_ssr_sections), 468 462 ATTR_LIST(max_victim_search), 463 + ATTR_LIST(migration_granularity), 469 464 ATTR_LIST(dir_level), 470 465 ATTR_LIST(ram_thresh), 471 466 ATTR_LIST(ra_nid_pages),