Skip to content

f2fs: “Fsync acceleration with roll-forward recovery” 具体步骤求详细~ #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
procr opened this issue Jun 19, 2016 · 4 comments

Comments

@procr
Copy link

procr commented Jun 19, 2016

No description provided.

@Emilio66
Copy link
Owner

F2FS performs roll-forward recovery as follows. If
we denote the log position of the last stable checkpoint
as N, (1) F2FS collects the direct node blocks having the
special flag located in N+n, while constructing a list of
their node information. n refers to the number of blocks
updated since the last checkpoint. (2) By using the node
information in the list, it loads the most recently written
node blocks, named N-n, into the page cache. (3) Then,
it compares the data indices in between N-n and N+n. (4)
If it detects different data indices, then it refreshes the
cached node blocks with the new indices stored in N+n,
and finally marks them as dirty. Once completing the
roll-forward recovery, F2FS performs checkpointing to
store the whole in-memory changes to the disk

@hxtsg
Copy link
Collaborator

hxtsg commented Jun 21, 2016

I don't quite understand what does this paragraph mean :)

@Emilio66
Copy link
Owner

个人理解是由于fsync操作经常要频繁写小文件,而flash是以block为单位写入,会有不想关的数据被重复写入,性能较差。因此F2FS提出只写入与更新有关的data block和direct node block,不写metadata,他在direct block里面设立了一个特殊flag用来标识这个操作。
在做recovery到时候,在checkpoint后面找到这个标识,比较一下checkpoint之前和之后的区别,就知道要新写入哪些文件,不用把不想关的数据重复写入,把这些新数据放到cache中标记为dirty 他们就会被刷到memory最后写入disk.
F2FS github文章已经更新这块的解答,可以参考一下。

@csurbhi
Copy link

csurbhi commented Dec 27, 2019

What does this mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants