Lines Matching +full:cpu +full:- +full:viewed

1 .. SPDX-License-Identifier: GPL-2.0
4 WHAT IS Flash-Friendly File System (F2FS)?
7 NAND flash memory-based storage devices, such as SSD, eMMC, and SD cards, have
13 F2FS is a file system exploiting NAND flash memory-based storage devices, which
14 is based on Log-structured File System (LFS). The design has been focused on
18 Since a NAND flash memory-based storage device shows different characteristic
20 F2FS and its tools support various parameters not only for configuring on-disk
26 - git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git
30 - linux-f2fs-devel@lists.sourceforge.net
34 - https://bugzilla.kernel.org/enter_bug.cgi?product=File%20System&component=f2fs
39 Log-structured File System (LFS)
40 --------------------------------
41 "A log-structured file system writes all modifications to disk sequentially in
42 a log-like structure, thereby speeding up both file writing and crash recovery.
48 implementation of a log-structured file system", ACM Trans. Computer Systems
52 ----------------------
61 [1] Bityutskiy, A. 2005. JFFS3 design issues. http://www.linux-mtd.infradead.org/
64 -----------------
65 Since LFS is based on out-of-place writes, it produces so many obsolete blocks
75 3. It checks the cross-reference between the data and its parent index structure.
86 ---------------
87 - Enlarge the random write area for better performance, but provide the high
89 - Align FS data structures to the operational units in FTL as best efforts
92 ----------------------
93 - Use a term, “node”, that represents inodes as well as various pointer blocks
94 - Introduce Node Address Table (NAT) containing the locations of all the “node”
98 -----------------
99 - Support a background cleaning process
100 - Support greedy and cost-benefit algorithms for victim selection policies
101 - Support multi-head logs for static/dynamic hot and cold data separation
102 - Introduce adaptive logging for efficient block allocation
121 I/O and CPU resources.
123 disable_roll_forward Disable the roll-forward recovery routine
124 norecovery Disable the roll-forward recovery routine, mounted read-
125 only (i.e., -o ro,disable_roll_forward)
126 discard/nodiscard Enable/disable real-time discard in f2fs, if discard is
164 extent_cache Enable an extent cache based on rb-tree, it can cache
168 noextent_cache Disable an extent cache based on rb-tree explicitly, see
215 fragmentation/after-GC situation itself. The developers use these
216 modes to understand filesystem fragmentation/after-GC condition well,
219 position. With this, we can simulate the after-GC condition.
230 recommend to re-format the filesystem after using these options.
253 non-atomic files likewise "nobarrier" mount option.
274 would be unusable can be viewed at /sys/fs/f2fs/<disk>/unusable
281 a cgroup having low i/o budget and cpu shares. To make this
288 "lz4", "zstd" and "lzo-rle" algorithm.
292 lz4 3 - 16
293 zstd 1 - 22
328 files using the blk-crypto framework rather than
329 filesystem-layer encryption. This allows the use of
330 inline encryption hardware. The on-disk format is
332 Documentation/block/inline-encryption.rst.
333 atgc Enable age-threshold garbage collection, it provides high
348 age_extent_cache Enable an age extent cache based on rb-tree. It records
353 "panic", "continue" and "remount-ro", respectively, trigger
355 the partition in read-only mode. By default it uses "continue"
358 mode continue remount-ro panic
361 syscall errors -EIO -EROFS N/A
364 pending non-dir write drop keep N/A
378 - major file system information managed by f2fs currently
379 - average SIT information about whole segments
380 - current memory footprint consumed by f2fs.
388 The files in each per-device directory are shown in table below.
391 (see also Documentation/ABI/testing/sysfs-fs-f2fs)
409 # mkfs.f2fs -l label /dev/block_device
410 # mount -t f2fs /dev/block_device /mnt/f2fs
413 ---------
415 which builds a basic on-disk layout.
420 ``-l [label]`` Give a volume label, up to 512 unicode name.
421 ``-a [0 or 1]`` Split start location of each area for heap-based allocation.
424 ``-o [int]`` Set overprovision ratio in percent over volume size.
427 ``-s [int]`` Set the number of segments per section.
430 ``-z [int]`` Set the number of sections per zone.
433 ``-e [str]`` Set basic extension list. e.g. "mp3,gif,mov"
434 ``-t [0 or 1]`` Disable discard command or not.
442 ---------
443 The fsck.f2fs is a tool to check the consistency of an f2fs-formatted
444 partition, which examines whether the filesystem metadata and user-made data
445 are cross-referenced correctly or not.
450 -d debug level [default:0]
455 ---------
459 The dump.f2fs is used to debug on-disk data structures of the f2fs filesystem.
460 It shows on-disk inode information recognized by a given inode number, and is
466 -d debug level [default:0]
467 -i inode no (hex)
468 -s [SIT dump segno from #1~#2 (decimal), for all 0~-1]
469 -a [SSA dump segno from #1~#2 (decimal), for all 0~-1]
473 # dump.f2fs -i [ino] /dev/sdx
474 # dump.f2fs -s 0~-1 /dev/sdx (SIT dump)
475 # dump.f2fs -a 0~-1 /dev/sdx (SSA dump)
480 ----------
487 -----------
488 The resize.f2fs lets a user resize the f2fs-formatted disk image, while preserving
494 -----------
502 -------
504 f2fs-specific ones, which is very useful for QA tests.
511 On-disk Layout
512 --------------
522 align with the zone size <-|
523 |-> align with the segment size
541 - Superblock (SB)
546 - Checkpoint (CP)
550 - Segment Information Table (SIT)
554 - Node Address Table (NAT)
558 - Segment Summary Area (SSA)
562 - Main Area
565 In order to avoid misalignment between file system and flash-based storage, F2FS
574 ------------------------------
585 +--------+----------+---------+
587 +--------+----------+---------+
591 +-------+-------+--------+--------+--------+--------+
593 +-------+-------+--------+--------+--------+--------+
596 `----------------------------------------'
599 ---------------
612 |- data (923)
613 |- direct node (2)
614 | `- data (1018)
615 |- indirect node (2)
616 | `- direct node (1018)
617 | `- data (1018)
618 `- double indirect node (1)
619 `- indirect node (1018)
620 `- direct node (1018)
621 `- data (1018)
629 -------------------
633 - hash hash value of the file name
634 - ino inode number
635 - len the length of file name
636 - type file type such as directory, symlink, etc
648 +--------------------------------+
650 +--------------------------------+
654 +--------+----------+----------+------------+
656 +--------+----------+----------+------------+
660 +------+------+-----+------+
662 +------+------+-----+------+
665 F2FS implements multi-level hash tables for directory structure. Each level has
671 ----------------------
675 ----------------------
679 level #1 | A(2B) - A(2B)
681 level #2 | A(2B) - A(2B) - A(2B) - A(2B)
683 level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
685 level #N | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
689 ,- 2, if n < MAX_DIR_HASH_DEPTH / 2,
691 `- 4, Otherwise
693 ,- 2^(n + dir_level),
696 `- 2^((MAX_DIR_HASH_DEPTH / 2) - 1),
715 --------------> Dir <--------------
719 child - child [hole] - child
721 child - child - child [hole] - [hole] - child
728 ------------------------
733 - Hot node contains direct node blocks of directories.
734 - Warm node contains direct node blocks except hot node blocks.
735 - Cold node contains indirect node blocks
736 - Hot data contains dentry blocks
737 - Warm data contains data blocks except hot and cold data blocks
738 - Cold data contains multimedia data or migrated data blocks
740 LFS has two schemes for free space management: threaded log and copy-and-compac-
741 tion. The copy-and-compaction scheme which is known as cleaning, is well-suited
746 scheme where the copy-and-compaction scheme is adopted by default, but the
750 In order to align F2FS with underlying flash-based storage, F2FS allocates a
758 ----------------
760 F2FS does cleaning both on demand and in the background. On-demand cleaning is
765 F2FS supports two victim selection policies: greedy and cost-benefit algorithms.
767 of valid blocks. In the cost-benefit algorithm, F2FS selects a victim segment
770 algorithm for on-demand cleaner, while background cleaner adopts cost-benefit
777 Write-hint Policy
778 -----------------
792 -- buffered io
797 -- direct io
807 -------------------
822 fallocate(fd, DEFAULT_MODE), it allocates on-disk block addresses having
833 --------------------------
835 - New term named cluster is defined as basic unit of compression, file can
840 - In cluster metadata layout, one special block address is used to indicate
842 metadata maps cluster to [1, 4 << n - 1] physical blocks, in where f2fs
845 - In order to eliminate write amplification during overwrite, F2FS only
846 support compression on write-once file, data can be compressed only when
850 - To enable compression on regular inode, there are four ways:
854 * mount w/ -o compress_extension=ext; touch file.ext
855 * mount w/ -o compress_extension=*; touch any_file
857 - To disable compression on regular inode, there are two ways:
859 * chattr -c file
860 * mount w/ -o nocompress_extension=ext; touch file.ext
862 - Priority in between FS_COMPR_FL, FS_NOCOMP_FS, extensions:
866 should be compresse, bar.zip should be non-compressed. chattr +c dir/bar.zip
868 * compress_extension=so; nocompress_extension=zip; chattr -c dir; touch
870 compresse, bar.zip and baz.txt should be non-compressed.
874 - At this point, compression feature doesn't expose compressed space to user
888 +-----------------------------------------------+
890 +-----------------------------------------------+
894 +----------+---------+---------+---------+ +---------+---------+---------+---------+
896 +----------+---------+---------+---------+ +---------+---------+---------+---------+
900 +-------------+-------------+----------+----------------------------+
902 +-------------+-------------+----------+----------------------------+
905 --------------------------
933 ----------------------------
935 - ZNS defines a per-zone capacity which can be equal or less than the
936 zone-size. Zone-capacity is the number of usable blocks in the zone.
937 F2FS checks if zone-capacity is less than zone-size, if it is, then any
938 segment which starts after the zone-capacity is marked as not-free in
942 zone-capacity is not aligned to default segment size(2MB), then a segment
943 can start before the zone-capacity and span across zone-capacity boundary.
945 past the zone-capacity are considered unusable in these segments.