1What: /sys/fs/f2fs/<disk>/gc_max_sleep_time 2Date: July 2013 3Contact: "Namjae Jeon" <namjae.jeon@samsung.com> 4Description: Controls the maximum sleep time for gc_thread. Time 5 is in milliseconds. 6 7What: /sys/fs/f2fs/<disk>/gc_min_sleep_time 8Date: July 2013 9Contact: "Namjae Jeon" <namjae.jeon@samsung.com> 10Description: Controls the minimum sleep time for gc_thread. Time 11 is in milliseconds. 12 13What: /sys/fs/f2fs/<disk>/gc_no_gc_sleep_time 14Date: July 2013 15Contact: "Namjae Jeon" <namjae.jeon@samsung.com> 16Description: Controls the default sleep time for gc_thread. Time 17 is in milliseconds. 18 19What: /sys/fs/f2fs/<disk>/gc_idle 20Date: July 2013 21Contact: "Namjae Jeon" <namjae.jeon@samsung.com> 22Description: Controls the victim selection policy for garbage collection. 23 Setting gc_idle = 0(default) will disable this option. Setting: 24 25 =========== =============================================== 26 gc_idle = 1 will select the Cost Benefit approach & setting 27 gc_idle = 2 will select the greedy approach & setting 28 gc_idle = 3 will select the age-threshold based approach. 29 =========== =============================================== 30 31What: /sys/fs/f2fs/<disk>/reclaim_segments 32Date: October 2013 33Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com> 34Description: This parameter controls the number of prefree segments to be 35 reclaimed. If the number of prefree segments is larger than 36 the number of segments in the proportion to the percentage 37 over total volume size, f2fs tries to conduct checkpoint to 38 reclaim the prefree segments to free segments. 39 By default, 5% over total # of segments. 40 41What: /sys/fs/f2fs/<disk>/main_blkaddr 42Date: November 2019 43Contact: "Ramon Pantin" <pantin@google.com> 44Description: 45 Shows first block address of MAIN area. 46 47What: /sys/fs/f2fs/<disk>/ipu_policy 48Date: November 2013 49Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com> 50Description: Controls the in-place-update policy. 51 updates in f2fs. User can set: 52 53 ==== ================= 54 0x01 F2FS_IPU_FORCE 55 0x02 F2FS_IPU_SSR 56 0x04 F2FS_IPU_UTIL 57 0x08 F2FS_IPU_SSR_UTIL 58 0x10 F2FS_IPU_FSYNC 59 0x20 F2FS_IPU_ASYNC, 60 0x40 F2FS_IPU_NOCACHE 61 ==== ================= 62 63 Refer segment.h for details. 64 65What: /sys/fs/f2fs/<disk>/min_ipu_util 66Date: November 2013 67Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com> 68Description: Controls the FS utilization condition for the in-place-update 69 policies. It is used by F2FS_IPU_UTIL and F2FS_IPU_SSR_UTIL policies. 70 71What: /sys/fs/f2fs/<disk>/min_fsync_blocks 72Date: September 2014 73Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 74Description: Controls the dirty page count condition for the in-place-update 75 policies. 76 77What: /sys/fs/f2fs/<disk>/min_seq_blocks 78Date: August 2018 79Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 80Description: Controls the dirty page count condition for batched sequential 81 writes in writepages. 82 83What: /sys/fs/f2fs/<disk>/min_hot_blocks 84Date: March 2017 85Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 86Description: Controls the dirty page count condition for redefining hot data. 87 88What: /sys/fs/f2fs/<disk>/min_ssr_sections 89Date: October 2017 90Contact: "Chao Yu" <yuchao0@huawei.com> 91Description: Controls the free section threshold to trigger SSR allocation. 92 If this is large, SSR mode will be enabled early. 93 94What: /sys/fs/f2fs/<disk>/max_small_discards 95Date: November 2013 96Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com> 97Description: Controls the issue rate of discard commands that consist of small 98 blocks less than 2MB. The candidates to be discarded are cached until 99 checkpoint is triggered, and issued during the checkpoint. 100 By default, it is disabled with 0. 101 102What: /sys/fs/f2fs/<disk>/discard_granularity 103Date: July 2017 104Contact: "Chao Yu" <yuchao0@huawei.com> 105Description: Controls discard granularity of inner discard thread. Inner thread 106 will not issue discards with size that is smaller than granularity. 107 The unit size is one block(4KB), now only support configuring 108 in range of [1, 512]. Default value is 4(=16KB). 109 110What: /sys/fs/f2fs/<disk>/umount_discard_timeout 111Date: January 2019 112Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 113Description: Set timeout to issue discard commands during umount. 114 Default: 5 secs 115 116What: /sys/fs/f2fs/<disk>/max_victim_search 117Date: January 2014 118Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com> 119Description: Controls the number of trials to find a victim segment 120 when conducting SSR and cleaning operations. The default value 121 is 4096 which covers 8GB block address range. 122 123What: /sys/fs/f2fs/<disk>/migration_granularity 124Date: October 2018 125Contact: "Chao Yu" <yuchao0@huawei.com> 126Description: Controls migration granularity of garbage collection on large 127 section, it can let GC move partial segment{s} of one section 128 in one GC cycle, so that dispersing heavy overhead GC to 129 multiple lightweight one. 130 131What: /sys/fs/f2fs/<disk>/dir_level 132Date: March 2014 133Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com> 134Description: Controls the directory level for large directory. If a 135 directory has a number of files, it can reduce the file lookup 136 latency by increasing this dir_level value. Otherwise, it 137 needs to decrease this value to reduce the space overhead. 138 The default value is 0. 139 140What: /sys/fs/f2fs/<disk>/ram_thresh 141Date: March 2014 142Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com> 143Description: Controls the memory footprint used by free nids and cached 144 nat entries. By default, 1 is set, which indicates 145 10 MB / 1 GB RAM. 146 147What: /sys/fs/f2fs/<disk>/batched_trim_sections 148Date: February 2015 149Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 150Description: Controls the trimming rate in batch mode. 151 <deprecated> 152 153What: /sys/fs/f2fs/<disk>/cp_interval 154Date: October 2015 155Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 156Description: Controls the checkpoint timing, set to 60 seconds by default. 157 158What: /sys/fs/f2fs/<disk>/idle_interval 159Date: January 2016 160Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 161Description: Controls the idle timing of system, if there is no FS operation 162 during given interval. 163 Set to 5 seconds by default. 164 165What: /sys/fs/f2fs/<disk>/discard_idle_interval 166Date: September 2018 167Contact: "Chao Yu" <yuchao0@huawei.com> 168Contact: "Sahitya Tummala" <stummala@codeaurora.org> 169Description: Controls the idle timing of discard thread given 170 this time interval. 171 Default is 5 secs. 172 173What: /sys/fs/f2fs/<disk>/gc_idle_interval 174Date: September 2018 175Contact: "Chao Yu" <yuchao0@huawei.com> 176Contact: "Sahitya Tummala" <stummala@codeaurora.org> 177Description: Controls the idle timing for gc path. Set to 5 seconds by default. 178 179What: /sys/fs/f2fs/<disk>/iostat_enable 180Date: August 2017 181Contact: "Chao Yu" <yuchao0@huawei.com> 182Description: Controls to enable/disable IO stat. 183 184What: /sys/fs/f2fs/<disk>/ra_nid_pages 185Date: October 2015 186Contact: "Chao Yu" <chao2.yu@samsung.com> 187Description: Controls the count of nid pages to be readaheaded. 188 When building free nids, F2FS reads NAT blocks ahead for 189 speed up. Default is 0. 190 191What: /sys/fs/f2fs/<disk>/dirty_nats_ratio 192Date: January 2016 193Contact: "Chao Yu" <chao2.yu@samsung.com> 194Description: Controls dirty nat entries ratio threshold, if current 195 ratio exceeds configured threshold, checkpoint will 196 be triggered for flushing dirty nat entries. 197 198What: /sys/fs/f2fs/<disk>/lifetime_write_kbytes 199Date: January 2016 200Contact: "Shuoran Liu" <liushuoran@huawei.com> 201Description: Shows total written kbytes issued to disk. 202 203What: /sys/fs/f2fs/<disk>/features 204Date: July 2017 205Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 206Description: Shows all enabled features in current device. 207 208What: /sys/fs/f2fs/<disk>/inject_rate 209Date: May 2016 210Contact: "Sheng Yong" <shengyong1@huawei.com> 211Description: Controls the injection rate of arbitrary faults. 212 213What: /sys/fs/f2fs/<disk>/inject_type 214Date: May 2016 215Contact: "Sheng Yong" <shengyong1@huawei.com> 216Description: Controls the injection type of arbitrary faults. 217 218What: /sys/fs/f2fs/<disk>/dirty_segments 219Date: October 2017 220Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 221Description: Shows the number of dirty segments. 222 223What: /sys/fs/f2fs/<disk>/reserved_blocks 224Date: June 2017 225Contact: "Chao Yu" <yuchao0@huawei.com> 226Description: Controls target reserved blocks in system, the threshold 227 is soft, it could exceed current available user space. 228 229What: /sys/fs/f2fs/<disk>/current_reserved_blocks 230Date: October 2017 231Contact: "Yunlong Song" <yunlong.song@huawei.com> 232Contact: "Chao Yu" <yuchao0@huawei.com> 233Description: Shows current reserved blocks in system, it may be temporarily 234 smaller than target_reserved_blocks, but will gradually 235 increase to target_reserved_blocks when more free blocks are 236 freed by user later. 237 238What: /sys/fs/f2fs/<disk>/gc_urgent 239Date: August 2017 240Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 241Description: Do background GC aggressively when set. When gc_urgent = 1, 242 background thread starts to do GC by given gc_urgent_sleep_time 243 interval. When gc_urgent = 2, F2FS will lower the bar of 244 checking idle in order to process outstanding discard commands 245 and GC a little bit aggressively. It is set to 0 by default. 246 247What: /sys/fs/f2fs/<disk>/gc_urgent_sleep_time 248Date: August 2017 249Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 250Description: Controls sleep time of GC urgent mode. Set to 500ms by default. 251 252What: /sys/fs/f2fs/<disk>/readdir_ra 253Date: November 2017 254Contact: "Sheng Yong" <shengyong1@huawei.com> 255Description: Controls readahead inode block in readdir. Enabled by default. 256 257What: /sys/fs/f2fs/<disk>/gc_pin_file_thresh 258Date: January 2018 259Contact: Jaegeuk Kim <jaegeuk@kernel.org> 260Description: This indicates how many GC can be failed for the pinned 261 file. If it exceeds this, F2FS doesn't guarantee its pinning 262 state. 2048 trials is set by default. 263 264What: /sys/fs/f2fs/<disk>/extension_list 265Date: Feburary 2018 266Contact: "Chao Yu" <yuchao0@huawei.com> 267Description: Used to control configure extension list: 268 - Query: cat /sys/fs/f2fs/<disk>/extension_list 269 - Add: echo '[h/c]extension' > /sys/fs/f2fs/<disk>/extension_list 270 - Del: echo '[h/c]!extension' > /sys/fs/f2fs/<disk>/extension_list 271 - [h] means add/del hot file extension 272 - [c] means add/del cold file extension 273 274What: /sys/fs/f2fs/<disk>/unusable 275Date April 2019 276Contact: "Daniel Rosenberg" <drosen@google.com> 277Description: If checkpoint=disable, it displays the number of blocks that 278 are unusable. 279 If checkpoint=enable it displays the number of blocks that 280 would be unusable if checkpoint=disable were to be set. 281 282What: /sys/fs/f2fs/<disk>/encoding 283Date July 2019 284Contact: "Daniel Rosenberg" <drosen@google.com> 285Description: Displays name and version of the encoding set for the filesystem. 286 If no encoding is set, displays (none) 287 288What: /sys/fs/f2fs/<disk>/free_segments 289Date: September 2019 290Contact: "Hridya Valsaraju" <hridya@google.com> 291Description: Number of free segments in disk. 292 293What: /sys/fs/f2fs/<disk>/cp_foreground_calls 294Date: September 2019 295Contact: "Hridya Valsaraju" <hridya@google.com> 296Description: Number of checkpoint operations performed on demand. Available when 297 CONFIG_F2FS_STAT_FS=y. 298 299What: /sys/fs/f2fs/<disk>/cp_background_calls 300Date: September 2019 301Contact: "Hridya Valsaraju" <hridya@google.com> 302Description: Number of checkpoint operations performed in the background to 303 free segments. Available when CONFIG_F2FS_STAT_FS=y. 304 305What: /sys/fs/f2fs/<disk>/gc_foreground_calls 306Date: September 2019 307Contact: "Hridya Valsaraju" <hridya@google.com> 308Description: Number of garbage collection operations performed on demand. 309 Available when CONFIG_F2FS_STAT_FS=y. 310 311What: /sys/fs/f2fs/<disk>/gc_background_calls 312Date: September 2019 313Contact: "Hridya Valsaraju" <hridya@google.com> 314Description: Number of garbage collection operations triggered in background. 315 Available when CONFIG_F2FS_STAT_FS=y. 316 317What: /sys/fs/f2fs/<disk>/moved_blocks_foreground 318Date: September 2019 319Contact: "Hridya Valsaraju" <hridya@google.com> 320Description: Number of blocks moved by garbage collection in foreground. 321 Available when CONFIG_F2FS_STAT_FS=y. 322 323What: /sys/fs/f2fs/<disk>/moved_blocks_background 324Date: September 2019 325Contact: "Hridya Valsaraju" <hridya@google.com> 326Description: Number of blocks moved by garbage collection in background. 327 Available when CONFIG_F2FS_STAT_FS=y. 328 329What: /sys/fs/f2fs/<disk>/avg_vblocks 330Date: September 2019 331Contact: "Hridya Valsaraju" <hridya@google.com> 332Description: Average number of valid blocks. 333 Available when CONFIG_F2FS_STAT_FS=y. 334 335What: /sys/fs/f2fs/<disk>/mounted_time_sec 336Date: February 2020 337Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 338Description: Show the mounted time in secs of this partition. 339 340What: /sys/fs/f2fs/<disk>/data_io_flag 341Date: April 2020 342Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 343Description: Give a way to attach REQ_META|FUA to data writes 344 given temperature-based bits. Now the bits indicate: 345 346 +-------------------+-------------------+ 347 | REQ_META | REQ_FUA | 348 +------+------+-----+------+------+-----+ 349 | 5 | 4 | 3 | 2 | 1 | 0 | 350 +------+------+-----+------+------+-----+ 351 | Cold | Warm | Hot | Cold | Warm | Hot | 352 +------+------+-----+------+------+-----+ 353 354What: /sys/fs/f2fs/<disk>/node_io_flag 355Date: June 2020 356Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 357Description: Give a way to attach REQ_META|FUA to node writes 358 given temperature-based bits. Now the bits indicate: 359 360 +-------------------+-------------------+ 361 | REQ_META | REQ_FUA | 362 +------+------+-----+------+------+-----+ 363 | 5 | 4 | 3 | 2 | 1 | 0 | 364 +------+------+-----+------+------+-----+ 365 | Cold | Warm | Hot | Cold | Warm | Hot | 366 +------+------+-----+------+------+-----+ 367 368What: /sys/fs/f2fs/<disk>/iostat_period_ms 369Date: April 2020 370Contact: "Daeho Jeong" <daehojeong@google.com> 371Description: Give a way to change iostat_period time. 3secs by default. 372 The new iostat trace gives stats gap given the period. 373What: /sys/fs/f2fs/<disk>/max_io_bytes 374Date: December 2020 375Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 376Description: This gives a control to limit the bio size in f2fs. 377 Default is zero, which will follow underlying block layer limit, 378 whereas, if it has a certain bytes value, f2fs won't submit a 379 bio larger than that size. 380 381What: /sys/fs/f2fs/<disk>/stat/sb_status 382Date: December 2020 383Contact: "Chao Yu" <yuchao0@huawei.com> 384Description: Show status of f2fs superblock in real time. 385 386 ====== ===================== ================================= 387 value sb status macro description 388 0x1 SBI_IS_DIRTY dirty flag for checkpoint 389 0x2 SBI_IS_CLOSE specify unmounting 390 0x4 SBI_NEED_FSCK need fsck.f2fs to fix 391 0x8 SBI_POR_DOING recovery is doing or not 392 0x10 SBI_NEED_SB_WRITE need to recover superblock 393 0x20 SBI_NEED_CP need to checkpoint 394 0x40 SBI_IS_SHUTDOWN shutdown by ioctl 395 0x80 SBI_IS_RECOVERED recovered orphan/data 396 0x100 SBI_CP_DISABLED CP was disabled last mount 397 0x200 SBI_CP_DISABLED_QUICK CP was disabled quickly 398 0x400 SBI_QUOTA_NEED_FLUSH need to flush quota info in CP 399 0x800 SBI_QUOTA_SKIP_FLUSH skip flushing quota in current CP 400 0x1000 SBI_QUOTA_NEED_REPAIR quota file may be corrupted 401 0x2000 SBI_IS_RESIZEFS resizefs is in process 402 ====== ===================== ================================= 403 404What: /sys/fs/f2fs/<disk>/ckpt_thread_ioprio 405Date: January 2021 406Contact: "Daeho Jeong" <daehojeong@google.com> 407Description: Give a way to change checkpoint merge daemon's io priority. 408 Its default value is "be,3", which means "BE" I/O class and 409 I/O priority "3". We can select the class between "rt" and "be", 410 and set the I/O priority within valid range of it. "," delimiter 411 is necessary in between I/O class and priority number. 412 413What: /sys/fs/f2fs/<disk>/ovp_segments 414Date: March 2021 415Contact: "Jaegeuk Kim" <jaegeuk@kernel.org> 416Description: Shows the number of overprovision segments. 417 418What: /sys/fs/f2fs/<disk>/compr_written_block 419Date: March 2021 420Contact: "Daeho Jeong" <daehojeong@google.com> 421Description: Show the block count written after compression since mount. Note 422 that when the compressed blocks are deleted, this count doesn't 423 decrease. If you write "0" here, you can initialize 424 compr_written_block and compr_saved_block to "0". 425 426What: /sys/fs/f2fs/<disk>/compr_saved_block 427Date: March 2021 428Contact: "Daeho Jeong" <daehojeong@google.com> 429Description: Show the saved block count with compression since mount. Note 430 that when the compressed blocks are deleted, this count doesn't 431 decrease. If you write "0" here, you can initialize 432 compr_written_block and compr_saved_block to "0". 433 434What: /sys/fs/f2fs/<disk>/compr_new_inode 435Date: March 2021 436Contact: "Daeho Jeong" <daehojeong@google.com> 437Description: Show the count of inode newly enabled for compression since mount. 438 Note that when the compression is disabled for the files, this count 439 doesn't decrease. If you write "0" here, you can initialize 440 compr_new_inode to "0". 441