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