forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/Documentation/ABI/testing/sysfs-fs-f2fs
....@@ -20,9 +20,13 @@
2020 Date: July 2013
2121 Contact: "Namjae Jeon" <namjae.jeon@samsung.com>
2222 Description: 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.
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
+ =========== ===============================================
2630
2731 What: /sys/fs/f2fs/<disk>/reclaim_segments
2832 Date: October 2013
....@@ -45,10 +49,18 @@
4549 Contact: "Jaegeuk Kim" <jaegeuk.kim@samsung.com>
4650 Description: Controls the in-place-update policy.
4751 updates in f2fs. User can set:
48
- 0x01: F2FS_IPU_FORCE, 0x02: F2FS_IPU_SSR,
49
- 0x04: F2FS_IPU_UTIL, 0x08: F2FS_IPU_SSR_UTIL,
50
- 0x10: F2FS_IPU_FSYNC, 0x20: F2FS_IPU_ASYNC,
51
- 0x40: F2FS_IPU_NOCACHE.
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
+ 0x80 F2FS_IPU_HONOR_OPU_WRITE
62
+ ==== =================
63
+
5264 Refer segment.h for details.
5365
5466 What: /sys/fs/f2fs/<disk>/min_ipu_util
....@@ -101,6 +113,11 @@
101113 Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
102114 Description: Set timeout to issue discard commands during umount.
103115 Default: 5 secs
116
+
117
+What: /sys/fs/f2fs/<disk>/pending_discard
118
+Date: November 2021
119
+Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
120
+Description: Shows the number of pending discard commands in the queue.
104121
105122 What: /sys/fs/f2fs/<disk>/max_victim_search
106123 Date: January 2014
....@@ -192,7 +209,34 @@
192209 What: /sys/fs/f2fs/<disk>/features
193210 Date: July 2017
194211 Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
195
-Description: Shows all enabled features in current device.
212
+Description: <deprecated: should use /sys/fs/f2fs/<disk>/feature_list/
213
+ Shows all enabled features in current device.
214
+ Supported features:
215
+ encryption, blkzoned, extra_attr, projquota, inode_checksum,
216
+ flexible_inline_xattr, quota_ino, inode_crtime, lost_found,
217
+ verity, sb_checksum, casefold, readonly, compression, pin_file.
218
+
219
+What: /sys/fs/f2fs/<disk>/feature_list/
220
+Date: June 2021
221
+Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
222
+Description: Expand /sys/fs/f2fs/<disk>/features to meet sysfs rule.
223
+ Supported on-disk features:
224
+ encryption, block_zoned (aka blkzoned), extra_attr,
225
+ project_quota (aka projquota), inode_checksum,
226
+ flexible_inline_xattr, quota_ino, inode_crtime, lost_found,
227
+ verity, sb_checksum, casefold, readonly, compression.
228
+ Note that, pin_file is moved into /sys/fs/f2fs/features/.
229
+
230
+What: /sys/fs/f2fs/features/
231
+Date: July 2017
232
+Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
233
+Description: Shows all enabled kernel features.
234
+ Supported features:
235
+ encryption, block_zoned, extra_attr, project_quota,
236
+ inode_checksum, flexible_inline_xattr, quota_ino,
237
+ inode_crtime, lost_found, verity, sb_checksum,
238
+ casefold, readonly, compression, test_dummy_encryption_v2,
239
+ atomic_write, pin_file, encrypted_casefold.
196240
197241 What: /sys/fs/f2fs/<disk>/inject_rate
198242 Date: May 2016
....@@ -229,7 +273,9 @@
229273 Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
230274 Description: Do background GC agressively when set. When gc_urgent = 1,
231275 background thread starts to do GC by given gc_urgent_sleep_time
232
- interval. It is set to 0 by default.
276
+ interval. When gc_urgent = 2, F2FS will lower the bar of
277
+ checking idle in order to process outstanding discard commands
278
+ and GC a little bit aggressively. It is set to 0 by default.
233279
234280 What: /sys/fs/f2fs/<disk>/gc_urgent_sleep_time
235281 Date: August 2017
....@@ -263,7 +309,7 @@
263309 Contact: "Daniel Rosenberg" <drosen@google.com>
264310 Description: If checkpoint=disable, it displays the number of blocks that
265311 are unusable.
266
- If checkpoint=enable it displays the enumber of blocks that
312
+ If checkpoint=enable it displays the number of blocks that
267313 would be unusable if checkpoint=disable were to be set.
268314
269315 What: /sys/fs/f2fs/<disk>/encoding
....@@ -329,21 +375,161 @@
329375 Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
330376 Description: Give a way to attach REQ_META|FUA to data writes
331377 given temperature-based bits. Now the bits indicate:
332
- * REQ_META | REQ_FUA |
333
- * 5 | 4 | 3 | 2 | 1 | 0 |
334
- * Cold | Warm | Hot | Cold | Warm | Hot |
378
+
379
+ +-------------------+-------------------+
380
+ | REQ_META | REQ_FUA |
381
+ +------+------+-----+------+------+-----+
382
+ | 5 | 4 | 3 | 2 | 1 | 0 |
383
+ +------+------+-----+------+------+-----+
384
+ | Cold | Warm | Hot | Cold | Warm | Hot |
385
+ +------+------+-----+------+------+-----+
335386
336387 What: /sys/fs/f2fs/<disk>/node_io_flag
337388 Date: June 2020
338389 Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
339390 Description: Give a way to attach REQ_META|FUA to node writes
340391 given temperature-based bits. Now the bits indicate:
341
- * REQ_META | REQ_FUA |
342
- * 5 | 4 | 3 | 2 | 1 | 0 |
343
- * Cold | Warm | Hot | Cold | Warm | Hot |
392
+
393
+ +-------------------+-------------------+
394
+ | REQ_META | REQ_FUA |
395
+ +------+------+-----+------+------+-----+
396
+ | 5 | 4 | 3 | 2 | 1 | 0 |
397
+ +------+------+-----+------+------+-----+
398
+ | Cold | Warm | Hot | Cold | Warm | Hot |
399
+ +------+------+-----+------+------+-----+
344400
345401 What: /sys/fs/f2fs/<disk>/iostat_period_ms
346402 Date: April 2020
347403 Contact: "Daeho Jeong" <daehojeong@google.com>
348404 Description: Give a way to change iostat_period time. 3secs by default.
349405 The new iostat trace gives stats gap given the period.
406
+What: /sys/fs/f2fs/<disk>/max_io_bytes
407
+Date: December 2020
408
+Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
409
+Description: This gives a control to limit the bio size in f2fs.
410
+ Default is zero, which will follow underlying block layer limit,
411
+ whereas, if it has a certain bytes value, f2fs won't submit a
412
+ bio larger than that size.
413
+
414
+What: /sys/fs/f2fs/<disk>/stat/sb_status
415
+Date: December 2020
416
+Contact: "Chao Yu" <yuchao0@huawei.com>
417
+Description: Show status of f2fs superblock in real time.
418
+
419
+ ====== ===================== =================================
420
+ value sb status macro description
421
+ 0x1 SBI_IS_DIRTY dirty flag for checkpoint
422
+ 0x2 SBI_IS_CLOSE specify unmounting
423
+ 0x4 SBI_NEED_FSCK need fsck.f2fs to fix
424
+ 0x8 SBI_POR_DOING recovery is doing or not
425
+ 0x10 SBI_NEED_SB_WRITE need to recover superblock
426
+ 0x20 SBI_NEED_CP need to checkpoint
427
+ 0x40 SBI_IS_SHUTDOWN shutdown by ioctl
428
+ 0x80 SBI_IS_RECOVERED recovered orphan/data
429
+ 0x100 SBI_CP_DISABLED CP was disabled last mount
430
+ 0x200 SBI_CP_DISABLED_QUICK CP was disabled quickly
431
+ 0x400 SBI_QUOTA_NEED_FLUSH need to flush quota info in CP
432
+ 0x800 SBI_QUOTA_SKIP_FLUSH skip flushing quota in current CP
433
+ 0x1000 SBI_QUOTA_NEED_REPAIR quota file may be corrupted
434
+ 0x2000 SBI_IS_RESIZEFS resizefs is in process
435
+ 0x4000 SBI_IS_FREEZING freefs is in process
436
+ ====== ===================== =================================
437
+
438
+What: /sys/fs/f2fs/<disk>/ckpt_thread_ioprio
439
+Date: January 2021
440
+Contact: "Daeho Jeong" <daehojeong@google.com>
441
+Description: Give a way to change checkpoint merge daemon's io priority.
442
+ Its default value is "be,3", which means "BE" I/O class and
443
+ I/O priority "3". We can select the class between "rt" and "be",
444
+ and set the I/O priority within valid range of it. "," delimiter
445
+ is necessary in between I/O class and priority number.
446
+
447
+What: /sys/fs/f2fs/<disk>/ovp_segments
448
+Date: March 2021
449
+Contact: "Jaegeuk Kim" <jaegeuk@kernel.org>
450
+Description: Shows the number of overprovision segments.
451
+
452
+What: /sys/fs/f2fs/<disk>/compr_written_block
453
+Date: March 2021
454
+Contact: "Daeho Jeong" <daehojeong@google.com>
455
+Description: Show the block count written after compression since mount. Note
456
+ that when the compressed blocks are deleted, this count doesn't
457
+ decrease. If you write "0" here, you can initialize
458
+ compr_written_block and compr_saved_block to "0".
459
+
460
+What: /sys/fs/f2fs/<disk>/compr_saved_block
461
+Date: March 2021
462
+Contact: "Daeho Jeong" <daehojeong@google.com>
463
+Description: Show the saved block count with compression since mount. Note
464
+ that when the compressed blocks are deleted, this count doesn't
465
+ decrease. If you write "0" here, you can initialize
466
+ compr_written_block and compr_saved_block to "0".
467
+
468
+What: /sys/fs/f2fs/<disk>/compr_new_inode
469
+Date: March 2021
470
+Contact: "Daeho Jeong" <daehojeong@google.com>
471
+Description: Show the count of inode newly enabled for compression since mount.
472
+ Note that when the compression is disabled for the files, this count
473
+ doesn't decrease. If you write "0" here, you can initialize
474
+ compr_new_inode to "0".
475
+
476
+What: /sys/fs/f2fs/<disk>/atgc_candidate_ratio
477
+Date: May 2021
478
+Contact: "Chao Yu" <yuchao0@huawei.com>
479
+Description: When ATGC is on, it controls candidate ratio in order to limit total
480
+ number of potential victim in all candidates, the value should be in
481
+ range of [0, 100], by default it was initialized as 20(%).
482
+
483
+What: /sys/fs/f2fs/<disk>/atgc_candidate_count
484
+Date: May 2021
485
+Contact: "Chao Yu" <yuchao0@huawei.com>
486
+Description: When ATGC is on, it controls candidate count in order to limit total
487
+ number of potential victim in all candidates, by default it was
488
+ initialized as 10 (sections).
489
+
490
+What: /sys/fs/f2fs/<disk>/atgc_age_weight
491
+Date: May 2021
492
+Contact: "Chao Yu" <yuchao0@huawei.com>
493
+Description: When ATGC is on, it controls age weight to balance weight proportion
494
+ in between aging and valid blocks, the value should be in range of
495
+ [0, 100], by default it was initialized as 60(%).
496
+
497
+What: /sys/fs/f2fs/<disk>/atgc_age_threshold
498
+Date: May 2021
499
+Contact: "Chao Yu" <yuchao0@huawei.com>
500
+Description: When ATGC is on, it controls age threshold to bypass GCing young
501
+ candidates whose age is not beyond the threshold, by default it was
502
+ initialized as 604800 seconds (equals to 7 days).
503
+
504
+What: /sys/fs/f2fs/<disk>/gc_reclaimed_segments
505
+Date: July 2021
506
+Contact: "Daeho Jeong" <daehojeong@google.com>
507
+Description: Show how many segments have been reclaimed by GC during a specific
508
+ GC mode (0: GC normal, 1: GC idle CB, 2: GC idle greedy,
509
+ 3: GC idle AT, 4: GC urgent high, 5: GC urgent low)
510
+ You can re-initialize this value to "0".
511
+
512
+What: /sys/fs/f2fs/<disk>/gc_segment_mode
513
+Date: July 2021
514
+Contact: "Daeho Jeong" <daehojeong@google.com>
515
+Description: You can control for which gc mode the "gc_reclaimed_segments" node shows.
516
+ Refer to the description of the modes in "gc_reclaimed_segments".
517
+
518
+What: /sys/fs/f2fs/<disk>/hot_data_age_threshold
519
+Date: November 2022
520
+Contact: "Ping Xiong" <xiongping1@xiaomi.com>
521
+Description: When DATA SEPARATION is on, it controls the age threshold to indicate
522
+ the data blocks as hot. By default it was initialized as 262144 blocks
523
+ (equals to 1GB).
524
+
525
+What: /sys/fs/f2fs/<disk>/warm_data_age_threshold
526
+Date: November 2022
527
+Contact: "Ping Xiong" <xiongping1@xiaomi.com>
528
+Description: When DATA SEPARATION is on, it controls the age threshold to indicate
529
+ the data blocks as warm. By default it was initialized as 2621440 blocks
530
+ (equals to 10GB).
531
+
532
+What: /sys/fs/f2fs/<disk>/last_age_weight
533
+Date: January 2023
534
+Contact: "Ping Xiong" <xiongping1@xiaomi.com>
535
+Description: When DATA SEPARATION is on, it controls the weight of last data block age.