xref: /linux/Documentation/ABI/testing/sysfs-fs-f2fs (revision 3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d)
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:	Shows first block address of MAIN area.
45
46What:		/sys/fs/f2fs/<disk>/ipu_policy
47Date:		November 2013
48Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
49Description:	Controls the in-place-update policy.
50		updates in f2fs. User can set:
51
52		===== =============== ===================================================
53		value policy          description
54		0x00  DISABLE         disable IPU(=default option in LFS mode)
55		0x01  FORCE           all the time
56		0x02  SSR             if SSR mode is activated
57		0x04  UTIL            if FS utilization is over threshold
58		0x08  SSR_UTIL        if SSR mode is activated and FS utilization is over
59		                      threshold
60		0x10  FSYNC           activated in fsync path only for high performance
61		                      flash storages. IPU will be triggered only if the
62		                      # of dirty pages over min_fsync_blocks.
63		                      (=default option)
64		0x20  ASYNC           do IPU given by asynchronous write requests
65		0x40  NOCACHE         disable IPU bio cache
66		0x80  HONOR_OPU_WRITE use OPU write prior to IPU write if inode has
67		                      FI_OPU_WRITE flag
68		===== =============== ===================================================
69
70		Refer segment.h for details.
71
72What:		/sys/fs/f2fs/<disk>/min_ipu_util
73Date:		November 2013
74Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
75Description:	Controls the FS utilization condition for the in-place-update
76		policies. It is used by F2FS_IPU_UTIL and F2FS_IPU_SSR_UTIL policies.
77
78What:		/sys/fs/f2fs/<disk>/min_fsync_blocks
79Date:		September 2014
80Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
81Description:	Controls the dirty page count condition for the in-place-update
82		policies.
83
84What:		/sys/fs/f2fs/<disk>/min_seq_blocks
85Date:		August 2018
86Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
87Description:	Controls the dirty page count condition for batched sequential
88		writes in writepages.
89
90What:		/sys/fs/f2fs/<disk>/min_hot_blocks
91Date:		March 2017
92Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
93Description:	Controls the dirty page count condition for redefining hot data.
94
95What:		/sys/fs/f2fs/<disk>/min_ssr_sections
96Date:		October 2017
97Contact:	"Chao Yu" <yuchao0@huawei.com>
98Description:	Controls the free section threshold to trigger SSR allocation.
99		If this is large, SSR mode will be enabled early.
100
101What:		/sys/fs/f2fs/<disk>/max_small_discards
102Date:		November 2013
103Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
104Description:	Controls the issue rate of discard commands that consist of small
105		blocks less than 2MB. The candidates to be discarded are cached during
106		checkpoint, and issued by issue_discard thread after checkpoint.
107		It is enabled by default.
108
109What:		/sys/fs/f2fs/<disk>/max_ordered_discard
110Date:		October 2022
111Contact:	"Yangtao Li" <frank.li@vivo.com>
112Description:	Controls the maximum ordered discard, the unit size is one block(4KB).
113		Set it to 16 by default.
114
115What:		/sys/fs/f2fs/<disk>/max_discard_request
116Date:		December 2021
117Contact:	"Konstantin Vyshetsky" <vkon@google.com>
118Description:	Controls the number of discards a thread will issue at a time.
119		Higher number will allow the discard thread to finish its work
120		faster, at the cost of higher latency for incoming I/O.
121
122What:		/sys/fs/f2fs/<disk>/min_discard_issue_time
123Date:		December 2021
124Contact:	"Konstantin Vyshetsky" <vkon@google.com>
125Description:	Controls the interval the discard thread will wait between
126		issuing discard requests when there are discards to be issued and
127		no I/O aware interruptions occur.
128
129What:		/sys/fs/f2fs/<disk>/mid_discard_issue_time
130Date:		December 2021
131Contact:	"Konstantin Vyshetsky" <vkon@google.com>
132Description:	Controls the interval the discard thread will wait between
133		issuing discard requests when there are discards to be issued and
134		an I/O aware interruption occurs.
135
136What:		/sys/fs/f2fs/<disk>/max_discard_issue_time
137Date:		December 2021
138Contact:	"Konstantin Vyshetsky" <vkon@google.com>
139Description:	Controls the interval the discard thread will wait when there are
140		no discard operations to be issued.
141
142What:		/sys/fs/f2fs/<disk>/discard_granularity
143Date:		July 2017
144Contact:	"Chao Yu" <yuchao0@huawei.com>
145Description:	Controls discard granularity of inner discard thread. Inner thread
146		will not issue discards with size that is smaller than granularity.
147		The unit size is one block(4KB), now only support configuring
148		in range of [1, 512]. Default value is 16.
149		For small devices, default value is 1.
150
151What:		/sys/fs/f2fs/<disk>/umount_discard_timeout
152Date:		January 2019
153Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
154Description:	Set timeout to issue discard commands during umount.
155	        Default: 5 secs
156
157What:		/sys/fs/f2fs/<disk>/pending_discard
158Date:		November 2021
159Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
160Description:	Shows the number of pending discard commands in the queue.
161
162What:		/sys/fs/f2fs/<disk>/max_victim_search
163Date:		January 2014
164Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
165Description:	Controls the number of trials to find a victim segment
166		when conducting SSR and cleaning operations. The default value
167		is 4096 which covers 8GB block address range.
168
169What:		/sys/fs/f2fs/<disk>/migration_granularity
170Date:		October 2018
171Contact:	"Chao Yu" <yuchao0@huawei.com>
172Description:	Controls migration granularity of garbage collection on large
173		section, it can let GC move partial segment{s} of one section
174		in one GC cycle, so that dispersing heavy overhead GC to
175		multiple lightweight one.
176
177What:		/sys/fs/f2fs/<disk>/dir_level
178Date:		March 2014
179Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
180Description:	Controls the directory level for large directory. If a
181		directory has a number of files, it can reduce the file lookup
182		latency by increasing this dir_level value. Otherwise, it
183		needs to decrease this value to reduce the space overhead.
184		The default value is 0.
185
186What:		/sys/fs/f2fs/<disk>/ram_thresh
187Date:		March 2014
188Contact:	"Jaegeuk Kim" <jaegeuk.kim@samsung.com>
189Description:	Controls the memory footprint used by free nids and cached
190		nat entries. By default, 1 is set, which indicates
191		10 MB / 1 GB RAM.
192
193What:		/sys/fs/f2fs/<disk>/cp_interval
194Date:		October 2015
195Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
196Description:	Controls the checkpoint timing, set to 60 seconds by default.
197
198What:		/sys/fs/f2fs/<disk>/idle_interval
199Date:		January 2016
200Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
201Description:	Controls the idle timing of system, if there is no FS operation
202		during given interval.
203		Set to 5 seconds by default.
204
205What:		/sys/fs/f2fs/<disk>/discard_idle_interval
206Date:		September 2018
207Contact:	"Chao Yu" <yuchao0@huawei.com>
208Contact:	"Sahitya Tummala" <quic_stummala@quicinc.com>
209Description:	Controls the idle timing of discard thread given
210		this time interval.
211		Default is 5 secs.
212
213What:		/sys/fs/f2fs/<disk>/gc_idle_interval
214Date:		September 2018
215Contact:	"Chao Yu" <yuchao0@huawei.com>
216Contact:	"Sahitya Tummala" <quic_stummala@quicinc.com>
217Description:    Controls the idle timing for gc path. Set to 5 seconds by default.
218
219What:		/sys/fs/f2fs/<disk>/iostat_enable
220Date:		August 2017
221Contact:	"Chao Yu" <yuchao0@huawei.com>
222Description:	Controls to enable/disable IO stat.
223
224What:		/sys/fs/f2fs/<disk>/ra_nid_pages
225Date:		October 2015
226Contact:	"Chao Yu" <chao2.yu@samsung.com>
227Description:	Controls the count of nid pages to be readaheaded.
228		When building free nids, F2FS reads NAT blocks ahead for
229		speed up. Default is 0.
230
231What:		/sys/fs/f2fs/<disk>/dirty_nats_ratio
232Date:		January 2016
233Contact:	"Chao Yu" <chao2.yu@samsung.com>
234Description:	Controls dirty nat entries ratio threshold, if current
235		ratio exceeds configured threshold, checkpoint will
236		be triggered for flushing dirty nat entries.
237
238What:		/sys/fs/f2fs/<disk>/lifetime_write_kbytes
239Date:		January 2016
240Contact:	"Shuoran Liu" <liushuoran@huawei.com>
241Description:	Shows total written kbytes issued to disk.
242
243What:		/sys/fs/f2fs/<disk>/features
244Date:		July 2017
245Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
246Description:	<deprecated: should use /sys/fs/f2fs/<disk>/feature_list/>
247		Shows all enabled features in current device.
248		Supported features:
249		encryption, blkzoned, extra_attr, projquota, inode_checksum,
250		flexible_inline_xattr, quota_ino, inode_crtime, lost_found,
251		verity, sb_checksum, casefold, readonly, compression, pin_file.
252
253What:		/sys/fs/f2fs/<disk>/feature_list/
254Date:		June 2021
255Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
256Description:	Expand /sys/fs/f2fs/<disk>/features to meet sysfs rule.
257		Supported on-disk features:
258		encryption, block_zoned (aka blkzoned), extra_attr,
259		project_quota (aka projquota), inode_checksum,
260		flexible_inline_xattr, quota_ino, inode_crtime, lost_found,
261		verity, sb_checksum, casefold, readonly, compression.
262		Note that, pin_file is moved into /sys/fs/f2fs/features/.
263
264What:		/sys/fs/f2fs/features/
265Date:		July 2017
266Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
267Description:	Shows all enabled kernel features.
268		Supported features:
269		encryption, block_zoned, extra_attr, project_quota,
270		inode_checksum, flexible_inline_xattr, quota_ino,
271		inode_crtime, lost_found, verity, sb_checksum,
272		casefold, readonly, compression, test_dummy_encryption_v2,
273		atomic_write, pin_file, encrypted_casefold, linear_lookup,
274		fserror.
275
276What:		/sys/fs/f2fs/<disk>/inject_rate
277Date:		May 2016
278Contact:	"Sheng Yong" <shengyong1@huawei.com>
279Description:	Controls the injection rate of arbitrary faults.
280
281What:		/sys/fs/f2fs/<disk>/inject_type
282Date:		May 2016
283Contact:	"Sheng Yong" <shengyong1@huawei.com>
284Description:	Controls the injection type of arbitrary faults.
285
286What:		/sys/fs/f2fs/<disk>/dirty_segments
287Date:		October 2017
288Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
289Description:	Shows the number of dirty segments.
290
291What:		/sys/fs/f2fs/<disk>/reserved_blocks
292Date:		June 2017
293Contact:	"Chao Yu" <yuchao0@huawei.com>
294Description:	Controls target reserved blocks in system, the threshold
295		is soft, it could exceed current available user space.
296
297What:		/sys/fs/f2fs/<disk>/current_reserved_blocks
298Date:		October 2017
299Contact:	"Yunlong Song" <yunlong.song@huawei.com>
300Contact:	"Chao Yu" <yuchao0@huawei.com>
301Description:	Shows current reserved blocks in system, it may be temporarily
302		smaller than target_reserved_blocks, but will gradually
303		increase to target_reserved_blocks when more free blocks are
304		freed by user later.
305
306What:		/sys/fs/f2fs/<disk>/gc_urgent
307Date:		August 2017
308Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
309Description:	Do background GC aggressively when set. Set to 0 by default.
310		gc urgent high(1): does GC forcibly in a period of given
311		gc_urgent_sleep_time and ignores I/O idling check. uses greedy
312		GC approach and turns SSR mode on.
313		gc urgent low(2): lowers the bar of checking I/O idling in
314		order to process outstanding discard commands and GC a
315		little bit aggressively. always uses cost benefit GC approach,
316		and will override age-threshold GC approach if ATGC is enabled
317		at the same time.
318		gc urgent mid(3): does GC forcibly in a period of given
319		gc_urgent_sleep_time and executes a mid level of I/O idling check.
320		always uses cost benefit GC approach, and will override
321		age-threshold GC approach if ATGC is enabled at the same time.
322
323What:		/sys/fs/f2fs/<disk>/gc_urgent_sleep_time
324Date:		August 2017
325Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
326Description:	Controls sleep time of GC urgent mode. Set to 500ms by default.
327
328What:		/sys/fs/f2fs/<disk>/readdir_ra
329Date:		November 2017
330Contact:	"Sheng Yong" <shengyong1@huawei.com>
331Description:	Controls readahead inode block in readdir. Enabled by default.
332
333What:		/sys/fs/f2fs/<disk>/gc_pin_file_thresh
334Date:		January 2018
335Contact:	Jaegeuk Kim <jaegeuk@kernel.org>
336Description:	This indicates how many GC can be failed for the pinned
337		file. If it exceeds this, F2FS doesn't guarantee its pinning
338		state. 2048 trials is set by default, and 65535 as maximum.
339
340What:		/sys/fs/f2fs/<disk>/extension_list
341Date:		February 2018
342Contact:	"Chao Yu" <yuchao0@huawei.com>
343Description:	Used to control configure extension list:
344		- Query: cat /sys/fs/f2fs/<disk>/extension_list
345		- Add: echo '[h/c]extension' > /sys/fs/f2fs/<disk>/extension_list
346		- Del: echo '[h/c]!extension' > /sys/fs/f2fs/<disk>/extension_list
347		- [h] means add/del hot file extension
348		- [c] means add/del cold file extension
349
350What:		/sys/fs/f2fs/<disk>/unusable
351Date:		April 2019
352Contact:	"Daniel Rosenberg" <drosen@google.com>
353Description:	If checkpoint=disable, it displays the number of blocks that
354		are unusable.
355		If checkpoint=enable it displays the number of blocks that
356		would be unusable if checkpoint=disable were to be set.
357
358What:		/sys/fs/f2fs/<disk>/encoding
359Date:		July 2019
360Contact:	"Daniel Rosenberg" <drosen@google.com>
361Description:	Displays name and version of the encoding set for the filesystem.
362		If no encoding is set, displays (none)
363
364What:		/sys/fs/f2fs/<disk>/free_segments
365Date:		September 2019
366Contact:	"Hridya Valsaraju" <hridya@google.com>
367Description:	Number of free segments in disk.
368
369What:		/sys/fs/f2fs/<disk>/cp_foreground_calls
370Date:		September 2019
371Contact:	"Hridya Valsaraju" <hridya@google.com>
372Description:	Number of checkpoint operations performed on demand. Available when
373		CONFIG_F2FS_STAT_FS=y.
374
375What:		/sys/fs/f2fs/<disk>/cp_background_calls
376Date:		September 2019
377Contact:	"Hridya Valsaraju" <hridya@google.com>
378Description:	Number of checkpoint operations performed in the background to
379		free segments. Available when CONFIG_F2FS_STAT_FS=y.
380
381What:		/sys/fs/f2fs/<disk>/gc_foreground_calls
382Date:		September 2019
383Contact:	"Hridya Valsaraju" <hridya@google.com>
384Description:	Number of garbage collection operations performed on demand.
385		Available when CONFIG_F2FS_STAT_FS=y.
386
387What:		/sys/fs/f2fs/<disk>/gc_background_calls
388Date:		September 2019
389Contact:	"Hridya Valsaraju" <hridya@google.com>
390Description:	Number of garbage collection operations triggered in background.
391		Available when CONFIG_F2FS_STAT_FS=y.
392
393What:		/sys/fs/f2fs/<disk>/moved_blocks_foreground
394Date:		September 2019
395Contact:	"Hridya Valsaraju" <hridya@google.com>
396Description:	Number of blocks moved by garbage collection in foreground.
397		Available when CONFIG_F2FS_STAT_FS=y.
398
399What:		/sys/fs/f2fs/<disk>/moved_blocks_background
400Date:		September 2019
401Contact:	"Hridya Valsaraju" <hridya@google.com>
402Description:	Number of blocks moved by garbage collection in background.
403		Available when CONFIG_F2FS_STAT_FS=y.
404
405What:		/sys/fs/f2fs/<disk>/avg_vblocks
406Date:		September 2019
407Contact:	"Hridya Valsaraju" <hridya@google.com>
408Description:	Average number of valid blocks.
409		Available when CONFIG_F2FS_STAT_FS=y.
410
411What:		/sys/fs/f2fs/<disk>/defrag_blocks
412Date:		February 2026
413Contact:	"Jinbao Liu" <liujinbao1@xiaomi.com>
414Description:	Number of blocks moved by defragment.
415		Available when CONFIG_F2FS_STAT_FS=y.
416
417What:		/sys/fs/f2fs/<disk>/mounted_time_sec
418Date:		February 2020
419Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
420Description:	Show the mounted time in secs of this partition.
421
422What:		/sys/fs/f2fs/<disk>/data_io_flag
423Date:		April 2020
424Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
425Description:	Give a way to attach REQ_META|FUA to data writes
426		given temperature-based bits. Now the bits indicate:
427
428		+-------------------+-------------------+
429		|      REQ_META     |      REQ_FUA      |
430		+------+------+-----+------+------+-----+
431		|    5 |    4 |   3 |    2 |    1 |   0 |
432		+------+------+-----+------+------+-----+
433		| Cold | Warm | Hot | Cold | Warm | Hot |
434		+------+------+-----+------+------+-----+
435
436What:		/sys/fs/f2fs/<disk>/node_io_flag
437Date:		June 2020
438Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
439Description:	Give a way to attach REQ_META|FUA to node writes
440		given temperature-based bits. Now the bits indicate:
441
442		+-------------------+-------------------+
443		|      REQ_META     |      REQ_FUA      |
444		+------+------+-----+------+------+-----+
445		|    5 |    4 |   3 |    2 |    1 |   0 |
446		+------+------+-----+------+------+-----+
447		| Cold | Warm | Hot | Cold | Warm | Hot |
448		+------+------+-----+------+------+-----+
449
450What:		/sys/fs/f2fs/<disk>/iostat_period_ms
451Date:		April 2020
452Contact:	"Daeho Jeong" <daehojeong@google.com>
453Description:	Give a way to change iostat_period time. 3secs by default.
454		The new iostat trace gives stats gap given the period.
455What:		/sys/fs/f2fs/<disk>/max_io_bytes
456Date:		December 2020
457Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
458Description:	This gives a control to limit the bio size in f2fs.
459		Default is zero, which will follow underlying block layer limit,
460		whereas, if it has a certain bytes value, f2fs won't submit a
461		bio larger than that size.
462
463What:		/sys/fs/f2fs/<disk>/stat/sb_status
464Date:		December 2020
465Contact:	"Chao Yu" <yuchao0@huawei.com>
466Description:	Show status of f2fs superblock in real time.
467
468		====== ===================== =================================
469		value  sb status macro       description
470		0x1    SBI_IS_DIRTY          dirty flag for checkpoint
471		0x2    SBI_IS_CLOSE          specify unmounting
472		0x4    SBI_NEED_FSCK         need fsck.f2fs to fix
473		0x8    SBI_POR_DOING         recovery is doing or not
474		0x10   SBI_NEED_SB_WRITE     need to recover superblock
475		0x20   SBI_NEED_CP           need to checkpoint
476		0x40   SBI_IS_SHUTDOWN       shutdown by ioctl
477		0x80   SBI_IS_RECOVERED      recovered orphan/data
478		0x100  SBI_CP_DISABLED       CP was disabled last mount
479		0x200  SBI_CP_DISABLED_QUICK CP was disabled quickly
480		0x400  SBI_QUOTA_NEED_FLUSH  need to flush quota info in CP
481		0x800  SBI_QUOTA_SKIP_FLUSH  skip flushing quota in current CP
482		0x1000 SBI_QUOTA_NEED_REPAIR quota file may be corrupted
483		0x2000 SBI_IS_RESIZEFS       resizefs is in process
484		0x4000 SBI_IS_FREEZING       freefs is in process
485		====== ===================== =================================
486
487What:		/sys/fs/f2fs/<disk>/stat/cp_status
488Date:		September 2022
489Contact:	"Chao Yu" <chao.yu@oppo.com>
490Description:	Show status of f2fs checkpoint in real time.
491
492		=============================== ==============================
493		cp flag				value
494		CP_UMOUNT_FLAG			0x00000001
495		CP_ORPHAN_PRESENT_FLAG		0x00000002
496		CP_COMPACT_SUM_FLAG		0x00000004
497		CP_ERROR_FLAG			0x00000008
498		CP_FSCK_FLAG			0x00000010
499		CP_FASTBOOT_FLAG		0x00000020
500		CP_CRC_RECOVERY_FLAG		0x00000040
501		CP_NAT_BITS_FLAG		0x00000080
502		CP_TRIMMED_FLAG			0x00000100
503		CP_NOCRC_RECOVERY_FLAG		0x00000200
504		CP_LARGE_NAT_BITMAP_FLAG	0x00000400
505		CP_QUOTA_NEED_FSCK_FLAG		0x00000800
506		CP_DISABLED_FLAG		0x00001000
507		CP_DISABLED_QUICK_FLAG		0x00002000
508		CP_RESIZEFS_FLAG		0x00004000
509		=============================== ==============================
510
511What:		/sys/fs/f2fs/<disk>/stat/issued_discard
512Date:		December 2023
513Contact:	"Zhiguo Niu" <zhiguo.niu@unisoc.com>
514Description:	Shows the number of issued discard.
515
516What:		/sys/fs/f2fs/<disk>/stat/queued_discard
517Date:		December 2023
518Contact:	"Zhiguo Niu" <zhiguo.niu@unisoc.com>
519Description:	Shows the number of queued discard.
520
521What:		/sys/fs/f2fs/<disk>/stat/undiscard_blks
522Date:		December 2023
523Contact:	"Zhiguo Niu" <zhiguo.niu@unisoc.com>
524Description:	Shows the total number of undiscard blocks.
525
526What:		/sys/fs/f2fs/<disk>/ckpt_thread_ioprio
527Date:		January 2021
528Contact:	"Daeho Jeong" <daehojeong@google.com>
529Description:	Give a way to change checkpoint merge daemon's io priority.
530		Its default value is "rt,3", which means "RT" I/O class and
531		I/O priority "3". We can select the class between "rt" and "be",
532		and set the I/O priority within valid range of it. "," delimiter
533		is necessary in between I/O class and priority number.
534
535What:		/sys/fs/f2fs/<disk>/ovp_segments
536Date:		March 2021
537Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
538Description:	Shows the number of overprovision segments.
539
540What:		/sys/fs/f2fs/<disk>/compr_written_block
541Date:		March 2021
542Contact:	"Daeho Jeong" <daehojeong@google.com>
543Description:	Show the block count written after compression since mount. Note
544		that when the compressed blocks are deleted, this count doesn't
545		decrease. If you write "0" here, you can initialize
546		compr_written_block and compr_saved_block to "0".
547
548What:		/sys/fs/f2fs/<disk>/compr_saved_block
549Date:		March 2021
550Contact:	"Daeho Jeong" <daehojeong@google.com>
551Description:	Show the saved block count with compression since mount. Note
552		that when the compressed blocks are deleted, this count doesn't
553		decrease. If you write "0" here, you can initialize
554		compr_written_block and compr_saved_block to "0".
555
556What:		/sys/fs/f2fs/<disk>/compr_new_inode
557Date:		March 2021
558Contact:	"Daeho Jeong" <daehojeong@google.com>
559Description:	Show the count of inode newly enabled for compression since mount.
560		Note that when the compression is disabled for the files, this count
561		doesn't decrease. If you write "0" here, you can initialize
562		compr_new_inode to "0".
563
564What:		/sys/fs/f2fs/<disk>/atgc_candidate_ratio
565Date:		May 2021
566Contact:	"Chao Yu" <yuchao0@huawei.com>
567Description:	When ATGC is on, it controls candidate ratio in order to limit total
568		number of potential victim in all candidates, the value should be in
569		range of [0, 100], by default it was initialized as 20(%).
570
571What:		/sys/fs/f2fs/<disk>/atgc_candidate_count
572Date:		May 2021
573Contact:	"Chao Yu" <yuchao0@huawei.com>
574Description:	When ATGC is on, it controls candidate count in order to limit total
575		number of potential victim in all candidates, by default it was
576		initialized as 10 (sections).
577
578What:		/sys/fs/f2fs/<disk>/atgc_age_weight
579Date:		May 2021
580Contact:	"Chao Yu" <yuchao0@huawei.com>
581Description:	When ATGC is on, it controls age weight to balance weight proportion
582		in between aging and valid blocks, the value should be in range of
583		[0, 100], by default it was initialized as 60(%).
584
585What:		/sys/fs/f2fs/<disk>/atgc_age_threshold
586Date:		May 2021
587Contact:	"Chao Yu" <yuchao0@huawei.com>
588Description:	When ATGC is on, it controls age threshold to bypass GCing young
589		candidates whose age is not beyond the threshold, by default it was
590		initialized as 604800 seconds (equals to 7 days).
591
592What:		/sys/fs/f2fs/<disk>/atgc_enabled
593Date:		Feb 2024
594Contact:	"Jinbao Liu" <liujinbao1@xiaomi.com>
595Description:	It represents whether ATGC is on or off. The value is 1 which
596               indicates that ATGC is on, and 0 indicates that it is off.
597
598What:		/sys/fs/f2fs/<disk>/gc_reclaimed_segments
599Date:		July 2021
600Contact:	"Daeho Jeong" <daehojeong@google.com>
601Description:	Show how many segments have been reclaimed by GC during a specific
602		GC mode (0: GC normal, 1: GC idle CB, 2: GC idle greedy,
603		3: GC idle AT, 4: GC urgent high, 5: GC urgent low 6: GC urgent mid)
604		You can re-initialize this value to "0".
605
606What:		/sys/fs/f2fs/<disk>/gc_segment_mode
607Date:		July 2021
608Contact:	"Daeho Jeong" <daehojeong@google.com>
609Description:	You can control for which gc mode the "gc_reclaimed_segments" node shows.
610		Refer to the description of the modes in "gc_reclaimed_segments".
611
612What:		/sys/fs/f2fs/<disk>/seq_file_ra_mul
613Date:		July 2021
614Contact:	"Daeho Jeong" <daehojeong@google.com>
615Description:	You can	control the multiplier value of	bdi device readahead window size
616		between 2 (default) and 256 for POSIX_FADV_SEQUENTIAL advise option.
617
618What:		/sys/fs/f2fs/<disk>/max_fragment_chunk
619Date:		August 2021
620Contact:	"Daeho Jeong" <daehojeong@google.com>
621Description:	With "mode=fragment:block" mount options, we can scatter block allocation.
622		f2fs will allocate 1..<max_fragment_chunk> blocks in a chunk and make a hole
623		in the length of 1..<max_fragment_hole> by turns. This value can be set
624		between 1..512 and the default value is 4.
625
626What:		/sys/fs/f2fs/<disk>/max_fragment_hole
627Date:		August 2021
628Contact:	"Daeho Jeong" <daehojeong@google.com>
629Description:	With "mode=fragment:block" mount options, we can scatter block allocation.
630		f2fs will allocate 1..<max_fragment_chunk> blocks in a chunk and make a hole
631		in the length of 1..<max_fragment_hole> by turns. This value can be set
632		between 1..512 and the default value is 4.
633
634What:		/sys/fs/f2fs/<disk>/gc_remaining_trials
635Date:		October 2022
636Contact:	"Yangtao Li" <frank.li@vivo.com>
637Description:	You can set the trial count limit for GC urgent and idle mode with this value.
638		If GC thread gets to the limit, the mode will turn back to GC normal mode.
639		By default, the value is zero, which means there is no limit like before.
640
641What:		/sys/fs/f2fs/<disk>/max_roll_forward_node_blocks
642Date:		January 2022
643Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
644Description:	Controls max # of node block writes to be used for roll forward
645		recovery. This can limit the roll forward recovery time.
646
647What:		/sys/fs/f2fs/<disk>/unusable_blocks_per_sec
648Date:		June 2022
649Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
650Description:	Shows the number of unusable blocks in a section which was defined by
651		the zone capacity reported by underlying zoned device.
652
653What:		/sys/fs/f2fs/<disk>/max_open_zones
654Date:		November 2025
655Contact:	"Yongpeng Yang" <yangyongpeng@xiaomi.com>
656Description:	Shows the max number of zones that F2FS can write concurrently when a zoned
657		device is mounted.
658
659What:		/sys/fs/f2fs/<disk>/current_atomic_write
660Date:		July 2022
661Contact:	"Daeho Jeong" <daehojeong@google.com>
662Description:	Show the total current atomic write block count, which is not committed yet.
663		This is a read-only entry.
664
665What:		/sys/fs/f2fs/<disk>/peak_atomic_write
666Date:		July 2022
667Contact:	"Daeho Jeong" <daehojeong@google.com>
668Description:	Show the peak value of total current atomic write block count after boot.
669		If you write "0" here, you can initialize to "0".
670
671What:		/sys/fs/f2fs/<disk>/committed_atomic_block
672Date:		July 2022
673Contact:	"Daeho Jeong" <daehojeong@google.com>
674Description:	Show the accumulated total committed atomic write block count after boot.
675		If you write "0" here, you can initialize to "0".
676
677What:		/sys/fs/f2fs/<disk>/revoked_atomic_block
678Date:		July 2022
679Contact:	"Daeho Jeong" <daehojeong@google.com>
680Description:	Show the accumulated total revoked atomic write block count after boot.
681		If you write "0" here, you can initialize to "0".
682
683What:		/sys/fs/f2fs/<disk>/gc_mode
684Date:		October 2022
685Contact:	"Yangtao Li" <frank.li@vivo.com>
686Description:	Show the current gc_mode as a string.
687		This is a read-only entry.
688
689What:		/sys/fs/f2fs/<disk>/discard_urgent_util
690Date:		November 2022
691Contact:	"Yangtao Li" <frank.li@vivo.com>
692Description:	When space utilization exceeds this, do background DISCARD aggressively.
693		Does DISCARD forcibly in a period of given min_discard_issue_time when the number
694		of discards is not 0 and set discard granularity to 1.
695		Default: 80
696
697What:		/sys/fs/f2fs/<disk>/hot_data_age_threshold
698Date:		November 2022
699Contact:	"Ping Xiong" <xiongping1@xiaomi.com>
700Description:	When DATA SEPARATION is on, it controls the age threshold to indicate
701		the data blocks as hot. By default it was initialized as 262144 blocks
702		(equals to 1GB).
703
704What:		/sys/fs/f2fs/<disk>/warm_data_age_threshold
705Date:		November 2022
706Contact:	"Ping Xiong" <xiongping1@xiaomi.com>
707Description:	When DATA SEPARATION is on, it controls the age threshold to indicate
708		the data blocks as warm. By default it was initialized as 2621440 blocks
709		(equals to 10GB).
710
711What:		/sys/fs/f2fs/<disk>/fault_rate
712Date:		May 2016
713Contact:	"Sheng Yong" <shengyong@oppo.com>
714Contact:	"Chao Yu" <chao@kernel.org>
715Description:	Enable fault injection in all supported types with
716		specified injection rate.
717
718What:		/sys/fs/f2fs/<disk>/fault_type
719Date:		May 2016
720Contact:	"Sheng Yong" <shengyong@oppo.com>
721Contact:	"Chao Yu" <chao@kernel.org>
722Description:	Support configuring fault injection type, should be
723		enabled with fault_injection option, fault type value
724		is shown below, it supports single or combined type.
725
726		===========================      ==========
727		Type_Name                        Type_Value
728		===========================      ==========
729		FAULT_KMALLOC                    0x00000001
730		FAULT_KVMALLOC                   0x00000002
731		FAULT_PAGE_ALLOC                 0x00000004
732		FAULT_PAGE_GET                   0x00000008
733		FAULT_ALLOC_BIO                  0x00000010 (obsolete)
734		FAULT_ALLOC_NID                  0x00000020
735		FAULT_ORPHAN                     0x00000040
736		FAULT_BLOCK                      0x00000080
737		FAULT_DIR_DEPTH                  0x00000100
738		FAULT_EVICT_INODE                0x00000200
739		FAULT_TRUNCATE                   0x00000400
740		FAULT_READ_IO                    0x00000800
741		FAULT_CHECKPOINT                 0x00001000
742		FAULT_DISCARD                    0x00002000 (obsolete)
743		FAULT_WRITE_IO                   0x00004000
744		FAULT_SLAB_ALLOC                 0x00008000
745		FAULT_DQUOT_INIT                 0x00010000
746		FAULT_LOCK_OP                    0x00020000
747		FAULT_BLKADDR_VALIDITY           0x00040000
748		FAULT_BLKADDR_CONSISTENCE        0x00080000
749		FAULT_NO_SEGMENT                 0x00100000
750		FAULT_INCONSISTENT_FOOTER        0x00200000
751		FAULT_ATOMIC_TIMEOUT             0x00400000 (1000ms)
752		FAULT_VMALLOC                    0x00800000
753		FAULT_LOCK_TIMEOUT               0x01000000 (1000ms)
754		FAULT_SKIP_WRITE                 0x02000000
755		===========================      ==========
756
757What:		/sys/fs/f2fs/<disk>/discard_io_aware_gran
758Date:		January 2023
759Contact:	"Yangtao Li" <frank.li@vivo.com>
760Description:	Controls background discard granularity of inner discard thread
761		when is not in idle. Inner thread will not issue discards with size that
762		is smaller than granularity. The unit size is one block(4KB), now only
763		support configuring in range of [0, 512].
764		Default: 512
765
766What:		/sys/fs/f2fs/<disk>/last_age_weight
767Date:		January 2023
768Contact:	"Ping Xiong" <xiongping1@xiaomi.com>
769Description:	When DATA SEPARATION is on, it controls the weight of last data block age.
770
771What:		/sys/fs/f2fs/<disk>/compress_watermark
772Date:		February 2023
773Contact:	"Yangtao Li" <frank.li@vivo.com>
774Description:	When compress cache is on, it controls free memory watermark
775		in order to limit caching compress page. If free memory is lower
776		than watermark, then deny caching compress page. The value should be in
777		range of (0, 100], by default it was initialized as 20(%).
778
779What:		/sys/fs/f2fs/<disk>/compress_percent
780Date:		February 2023
781Contact:	"Yangtao Li" <frank.li@vivo.com>
782Description:	When compress cache is on, it controls cached page
783		percent(compress pages / free_ram) in order to limit caching compress page.
784		If cached page percent exceed threshold, then deny caching compress page.
785		The value should be in range of (0, 100], by default it was initialized
786		as 20(%).
787
788What:		/sys/fs/f2fs/<disk>/discard_io_aware
789Date:		November 2023
790Contact:	"Chao Yu" <chao@kernel.org>
791Description:	It controls to enable/disable IO aware feature for background discard.
792		By default, the value is 1 which indicates IO aware is on.
793
794What:		/sys/fs/f2fs/<disk>/blkzone_alloc_policy
795Date:		July 2024
796Contact:	"Yuanhong Liao" <liaoyuanhong@vivo.com>
797Description:	The zone UFS we are currently using consists of two parts:
798		conventional zones and sequential zones. It can be used to control which part
799		to prioritize for writes, with a default value of 0.
800
801		========================  =========================================
802		value					  description
803		blkzone_alloc_policy = 0  Prioritize writing to sequential zones
804		blkzone_alloc_policy = 1  Only allow writing to sequential zones
805		blkzone_alloc_policy = 2  Prioritize writing to conventional zones
806		========================  =========================================
807
808What:		/sys/fs/f2fs/<disk>/migration_window_granularity
809Date:		September 2024
810Contact:	"Daeho Jeong" <daehojeong@google.com>
811Description:	Controls migration window granularity of garbage collection on large
812		section. it can control the scanning window granularity for GC migration
813		in a unit of segment, while migration_granularity controls the number
814		of segments which can be migrated at the same turn.
815
816What:		/sys/fs/f2fs/<disk>/reserved_segments
817Date:		September 2024
818Contact:	"Daeho Jeong" <daehojeong@google.com>
819Description:	In order to fine tune GC behavior, we can control the number of
820		reserved segments.
821
822What:		/sys/fs/f2fs/<disk>/gc_no_zoned_gc_percent
823Date:		September 2024
824Contact:	"Daeho Jeong" <daehojeong@google.com>
825Description:	If the percentage of free sections over total sections is above this
826		number, F2FS do not garbage collection for zoned devices through the
827		background GC thread. the default number is "60".
828
829What:		/sys/fs/f2fs/<disk>/gc_boost_zoned_gc_percent
830Date:		September 2024
831Contact:	"Daeho Jeong" <daehojeong@google.com>
832Description:	If the percentage of free sections over total sections is under this
833		number, F2FS boosts garbage collection for zoned devices through the
834		background GC thread. the default number is "25".
835
836What:		/sys/fs/f2fs/<disk>/gc_valid_thresh_ratio
837Date:		September 2024
838Contact:	"Daeho Jeong" <daehojeong@google.com>
839Description:	It controls the valid block ratio threshold not to trigger excessive GC
840		for zoned devices. The initial value of it is 95(%). F2FS will stop the
841		background GC thread from initiating GC for sections having valid blocks
842		exceeding the ratio.
843
844What:		/sys/fs/f2fs/<disk>/max_read_extent_count
845Date:		November 2024
846Contact:	"Chao Yu" <chao@kernel.org>
847Description:	It controls max read extent count for per-inode, the value of threshold
848		is 10240 by default.
849
850What:		/sys/fs/f2fs/tuning/reclaim_caches_kb
851Date:		February 2025
852Contact:	"Jaegeuk Kim" <jaegeuk@kernel.org>
853Description:	It reclaims the given KBs of file-backed pages registered by
854		ioctl(F2FS_IOC_DONATE_RANGE).
855		For example, writing N tries to drop N KBs spaces in LRU.
856
857What:		/sys/fs/f2fs/<disk>/carve_out
858Date:		March 2025
859Contact:	"Daeho Jeong" <daehojeong@google.com>
860Description:	For several zoned storage devices, vendors will provide extra space which
861		was used for device level GC than specs and F2FS can use this space for
862		filesystem level GC. To do that, we can reserve the space using
863		reserved_blocks. However, it is not enough, since this extra space should
864		not be shown to users. So, with this new sysfs node, we can hide the space
865		by subtracting reserved_blocks from total bytes.
866
867What:		/sys/fs/f2fs/<disk>/encoding_flags
868Date:		April 2025
869Contact:	"Chao Yu" <chao@kernel.org>
870Description:	This is a read-only entry to show the value of sb.s_encoding_flags, the
871		value is hexadecimal.
872
873		============================     ==========
874		Flag_Name                        Flag_Value
875		============================     ==========
876		SB_ENC_STRICT_MODE_FL            0x00000001
877		SB_ENC_NO_COMPAT_FALLBACK_FL     0x00000002
878		============================     ==========
879
880What:		/sys/fs/f2fs/<disk>/reserved_pin_section
881Date:		June 2025
882Contact:	"Chao Yu" <chao@kernel.org>
883Description:	This threshold is used to control triggering garbage collection while
884		fallocating on pinned file, so, it can guarantee there is enough free
885		reserved section before preallocating on pinned file.
886		By default, the value is ovp_sections, especially, for zoned ufs, the
887		value is 1.
888
889What:		/sys/fs/f2fs/<disk>/gc_boost_gc_multiple
890Date:		June 2025
891Contact:	"Daeho Jeong" <daehojeong@google.com>
892Description:	Set a multiplier for the background GC migration window when F2FS GC is
893		boosted. The range should be from 1 to the segment count in a section.
894		Default: 5
895
896What:		/sys/fs/f2fs/<disk>/gc_boost_gc_greedy
897Date:		June 2025
898Contact:	"Daeho Jeong" <daehojeong@google.com>
899Description:	Control GC algorithm for boost GC. 0: cost benefit, 1: greedy
900		Default: 1
901
902What:		/sys/fs/f2fs/<disk>/effective_lookup_mode
903Date:		August 2025
904Contact:	"Daniel Lee" <chullee@google.com>
905Description:
906		This is a read-only entry to show the effective directory lookup mode
907		F2FS is currently using for casefolded directories.
908		This considers both the "lookup_mode" mount option and the on-disk
909		encoding flag, SB_ENC_NO_COMPAT_FALLBACK_FL.
910
911		Possible values are:
912		- "perf": Hash-only lookup.
913		- "compat": Hash-based lookup with a linear search fallback enabled
914		- "auto:perf": lookup_mode is auto and fallback is disabled on-disk
915		- "auto:compat": lookup_mode is auto and fallback is enabled on-disk
916
917What:		/sys/fs/f2fs/<disk>/bggc_io_aware
918Date:		August 2025
919Contact:	"Liao Yuanhong" <liaoyuanhong@vivo.com>
920Description:	Used to adjust the BG_GC priority when pending IO, with a default value
921		of 0. Specifically, for ZUFS, the default value is 1.
922
923		==================  ======================================================
924		value				description
925		bggc_io_aware = 0   skip background GC if there is any kind of pending IO
926		bggc_io_aware = 1   skip background GC if there is pending read IO
927		bggc_io_aware = 2   don't aware IO for background GC
928		==================  ======================================================
929
930What:		/sys/fs/f2fs/<disk>/allocate_section_hint
931Date:		August 2025
932Contact:	"Liao Yuanhong" <liaoyuanhong@vivo.com>
933Description:	Indicates the hint section between the first device and others in multi-devices
934		setup. It defaults to the end of the first device in sections. For a single storage
935		device, it defaults to the total number of sections. It can be manually set to match
936		scenarios where multi-devices are mapped to the same dm device.
937
938What:		/sys/fs/f2fs/<disk>/allocate_section_policy
939Date:		August 2025
940Contact:	"Liao Yuanhong" <liaoyuanhong@vivo.com>
941Description:	Controls write priority in multi-devices setups. A value of 0 means normal writing.
942		A value of 1 prioritizes writing to devices before the allocate_section_hint. A value of 2
943		prioritizes writing to devices after the allocate_section_hint. The default is 0.
944
945		===========================  ==========================================================
946		value					     description
947		allocate_section_policy = 0  Normal writing
948		allocate_section_policy = 1  Prioritize writing to section before allocate_section_hint
949		allocate_section_policy = 2  Prioritize writing to section after allocate_section_hint
950		===========================  ==========================================================
951
952What:		/sys/fs/f2fs/<disk>/max_lock_elapsed_time
953Date:		December 2025
954Contact:	"Chao Yu" <chao@kernel.org>
955Description:	This is a threshold, once a thread enters critical region that lock covers, total
956		elapsed time exceeds this threshold, f2fs will print tracepoint to dump information
957		of related context. This sysfs entry can be used to control the value of threshold,
958		by default, the value is 500 ms.
959
960What:		/sys/fs/f2fs/<disk>/inject_timeout_type
961Date:		December 2025
962Contact:	"Chao Yu" <chao@kernel.org>
963Description:	This sysfs entry can be used to change type of injected timeout:
964		==========     ===============================
965		Flag_Value     Flag_Description
966		==========     ===============================
967		0x00000000     No timeout (default)
968		0x00000001     Simulate running time
969		0x00000002     Simulate IO type sleep time
970		0x00000003     Simulate Non-IO type sleep time
971		0x00000004     Simulate runnable time
972		==========     ===============================
973
974What:		/sys/fs/f2fs/<disk>/adjust_lock_priority
975Date:		January 2026
976Contact:	"Chao Yu" <chao@kernel.org>
977Description:	This sysfs entry can be used to enable/disable to adjust priority for task
978		which is in critical region covered by lock.
979		==========     ==================
980		Flag_Value     Flag_Description
981		==========     ==================
982		0x00000000     Disabled (default)
983		0x00000001     cp_rwsem
984		0x00000002     node_change
985		0x00000004     node_write
986		0x00000008     gc_lock
987		0x00000010     cp_global
988		0x00000020     io_rwsem
989		0x00000040     nat_tree_lock
990		==========     ==================
991
992What:		/sys/fs/f2fs/<disk>/lock_duration_priority
993Date:		January 2026
994Contact:	"Chao Yu" <chao@kernel.org>
995Description:	f2fs can tune priority of thread which has entered into critical region covered by
996		f2fs rwsemphore lock. This sysfs entry can be used to control priority value, the
997		range is [100,139], by default the value is 120.
998
999What:		/sys/fs/f2fs/<disk>/critical_task_priority
1000Date:		February 2026
1001Contact:	"Chao Yu" <chao@kernel.org>
1002Description:	It can be used to tune priority of f2fs critical task, e.g. f2fs_ckpt, f2fs_gc
1003		threads, limitation as below:
1004		- it requires user has CAP_SYS_NICE capability.
1005		- the range is [100, 139], by default the value is 120.
1006
1007What:		/sys/fs/f2fs/<disk>/max_atc_write_bio_size
1008Date:		June 2026
1009Contact:	Bart Van Assche <bvanassche@acm.org>
1010Description:	Every time a write operation completes f2fs_write_end_io() is
1011		called. This function may be called from an atomic context,
1012		e.g. from inside an interrupt handler. This attribute controls
1013		the maximum size of a write bio that is completed in atomic
1014		(atc) context. The default value for this attribute is UINT_MAX
1015		which means that this functionality is disabled by default.
1016
1017What:		/sys/fs/f2fs/<disk>/pinned_area_max_secno
1018Date:		August 2026
1019Contact:	"Daeho Jeong" <daehojeong@google.com>
1020Description:	This is a read-only entry to show the upper bound section number
1021		for pinned files. Pinned files will only be allocated within
1022		sections 0 to pinned_area_max_secno - 1.
1023