]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: lookup neighbor extent nodes for merging later
authorChao Yu <chao2.yu@samsung.com>
Wed, 19 Aug 2015 11:16:09 +0000 (19:16 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 22 Aug 2015 05:45:18 +0000 (22:45 -0700)
commit821bd4516e2ef64e6933bd216b75cd5679886fa2
treed090fbadfba9ce6b8a36cfc04d7e66ea87dab463
parent8111f5957850af99c83057c944fe0d3e0d571d6b
f2fs: lookup neighbor extent nodes for merging later

In __lookup_extent_tree_ret we will not try to find neighbor nodes if
we find the target node, in this condition, we will lost the chance to
merge the new mapping with exist extent node later.

So our extent cache of inode will be fragmented after overwrite exist
file, we can see the number of extent node increases intensively in
following test case:

dd if=/dev/zero of=/mnt/f2fs/4m bs=4K count=1024

Extent Cache:
  - Hit Count: L1-1:0 L1-2:0 L2:0
  - Hit Ratio: 0% (0 / 3072)
  - Inner Struct Count: tree: 1, node: 1

dd if=/dev/zero of=/mnt/f2fs/4m bs=4K count=1024 conv=notrunc

Extent Cache:
  - Hit Count: L1-1:2048 L1-2:0 L2:0
  - Hit Ratio: 33% (2048 / 6144)
  - Inner Struct Count: tree: 1, node: 961

This patch fixes to lookup neighbors of target node for further
merging.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/extent_cache.c