]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: improve fsync by filtering extents that we want
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 27 Aug 2012 16:52:20 +0000 (10:52 -0600)
committerChris Mason <chris.mason@fusionio.com>
Mon, 1 Oct 2012 19:19:05 +0000 (15:19 -0400)
commit01cb2797ba8d0c60000eab99c5021549e10c90ae
tree31691a22773cf249fc289d8414be62b52d071513
parent182c0bb72ad95ea9804c2920e0c731a61063cc32
Btrfs: improve fsync by filtering extents that we want

This is based on Josef's "Btrfs: turbo charge fsync".

The above Josef's patch performs very good in random sync write test,
because we won't have too much extents to merge.

However, it does not performs good on the test:
dd if=/dev/zero of=foobar bs=4k count=12500 oflag=sync

The reason is when we do sequencial sync write, we need to merge the
current extent just with the previous one, so that we can get accumulated
extents to log:

A(4k) --> AA(8k) --> AAA(12k) --> AAAA(16k) ...

So we'll have to flush more and more checksum into log tree, which is the
bottleneck according to my tests.

But we can avoid this by telling fsync the real extents that are needed
to be logged.

With this, I did the above dd sync write test (size=50m),

         w/o (orig)   w/ (josef's)   w/ (this)
SATA      104KB/s       109KB/s       121KB/s
ramdisk   1.5MB/s       1.5MB/s       10.7MB/s (613%)

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/extent_map.c
fs/btrfs/extent_map.h
fs/btrfs/inode.c
fs/btrfs/tree-log.c