Boost the remove operation #74
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inspired by Ext4's rec_len, add nr_blk in struct simplefs_file to record how many contiguous blocks a file occupies. This method quickly locate the next available block for storing new file data.
Additionally, it improves the removal process in directories — by setting the inode to 0 and merging block information with the previous entry
there is the test data:
remove 30600 files
legacy:
24855.97 msec task-clock # 0.965 CPUs utilized
6809 context-switches # 273.938 /sec
9 cpu-migrations # 0.362 /sec
2287 page-faults # 92.010 /sec
58198042110 cycles # 2.341 GHz
45389686010 instructions # 0.78 insn per cycle
10407138113 branches # 418.698 M/sec
18144553 branch-misses # 0.17% of all branches
like ext4
13845.94 msec task-clock # 1.000 CPUs utilized
68 context-switches # 4.911 /sec
0 cpu-migrations # 0.000 /sec
2285 page-faults # 165.030 /sec
34152461876 cycles # 2.467 GHz
41149033388 instructions # 1.20 insn per cycle
9555245488 branches # 690.112 M/sec
5952012 branch-misses # 0.06% of all branches
close #63