F2FS file system architecture and Principle Analysis (i)--design background and function

Source: Internet
Author: User

This article reprinted to: Http://blog.chinaunix.net/uid-28989651-id-3878690.html


1 f2fs File System Introduction

F2FS (Flash friendly file system) is a new open source Flash file system designed specifically for NAND-based storage devices. Designed specifically for NAND flash storage media. F2fs entered the Linux 3.8 kernel in December 2012. Currently, F2FS only supports Linux operating systems.

F2FS Select the Log-structured file system scheme and make it more adaptable to the new storage medium (NAND). Also, fixed some known issues with the legacy log structure file system, such as (1) The snowball effect of the wandering tree and (2) high cleanup overhead.

Flash storage devices have many different properties depending on the internal geometry and flash management mechanism (FTL), so the F2FS designers add a variety of parameters, not only for configuring disk layouts, but also for allocating and cleaning algorithms to optimize performance (parallel IO improves performance).


1.1 f2fs File system design background and main problems to be solved
1.1.1 LFS (log-strctured File System)

To manage large contiguous space on the disk for fast write data, divide the log into segments, use Segment Cleaner to transfer valid information from the heavily fragmented Segment, and then clean the Segment for subsequent write data.
1.1.2 Wandering Tree problem

In LFS, when the data block of a file is updated to the end of the log, the direct pointer to the data block is changed because of the change in the data location, and then the indirect pointer block is updated because of the immediate pointer block update. In this way, the upper-level index structures, such as inode, Inode map, and checkpoint block, are also updated recursively. This is the so-called wandering tree problem. To improve performance, the update node propagation of wandering tree should be eliminated or reduced as much as possible when the data block is updated.
1.1.3 Cleaning Overhead

In order to generate a new log free space, LFS needs to reclaim invalid blocks of data and free up free space, a process known as the cleaning process. The cleaning process includes the following actions:

(1) Select a segment by finding the list of segment use cases;

(2) The parent index structure of all data blocks in the selected segment is identified and loaded into memory by Segment summary Block;

(3) Checking the cross-references of the data and its parent index structure;

(4) Select valid data to transfer valid data.

Cleaning work can cause unpredictable long delays, so an important issue LFS to solve is to hide this delay from the user, and should reduce the amount of data that needs to be transferred and quickly transfer data.
2 F2fs file system features and Functions
features and functionality not supported by 2.1 F2FS (may be supported later)

The current F2FS does not support the following features, but these features are supported later if necessary:

(1) Snapshot

(2) User quotas-most difficult to achieve

(3) NFS not supported

(4) Extension features not supported for "security" (Xattrs)
features and functions of 2.2 f2fs

The F2FS has the following features and functions:

(1) Maximum file system 16TB;

(2) 32-bit block addressing space;

(3) Maximum file size 3.94TB;

(4) log-structured;

(5) Flash Sensing

A) Expand the random write region (metadata region, two-location) to obtain better performance;

b) Try to align the data structure of the F2FS with the operating parts of the FTL.

(6) Solve wandering Tree problem

A) Use the term "node" to denote the inode and various index pointer blocks;

b) The introduction of Node Address Table (NAT) contains the location of all "Node" blocks, which will cut off recursive propagation of data block updates.

(7) Minimizing cleaning overhead

A) support background cleaning process;

b) support for greedy and low cost (minimum transfer data) to clean up the section selection algorithm;

c) Support Multi-head logs for dynamic/static hot and cold data separation;

d) Introduce adaptive logging for efficient block allocation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.