]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: implement unlocked dio write
authorMiao Xie <miaox@cn.fujitsu.com>
Fri, 8 Feb 2013 07:04:11 +0000 (07:04 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 20 Feb 2013 17:59:48 +0000 (12:59 -0500)
commitca462ffc9340fd3f005b282f17bec0c9dc097896
tree4efe5e9ff5c776b73ec149ce29dd8e67bc4394cc
parentc580081482493a0c69cc9d55e1118427e259899d
Btrfs: implement unlocked dio write

This idea is from ext4. By this patch, we can make the dio write parallel,
and improve the performance. But because we can not update isize without
i_mutex, the unlocked dio write just can be done in front of the EOF.

We needn't worry about the race between dio write and truncate, because the
truncate need wait untill all the dio write end.

And we also needn't worry about the race between dio write and punch hole,
because we have extent lock to protect our operation.

I ran fio to test the performance of this feature.

== Hardware ==
CPU: Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz
Mem: 2GB
SSD: Intel X25-M 120GB (Test Partition: 60GB)

== config file ==
[global]
ioengine=psync
direct=1
bs=4k
size=32G
runtime=60
directory=/mnt/btrfs/
filename=testfile
group_reporting
thread

[file1]
numjobs=1 # 2 4
rw=randwrite

== result (KBps) ==
write 1 2 4
lock 24936 24738 24726
nolock 24962 30866 32101

== result (iops) ==
write 1 2 4
lock 6234 6184 6181
nolock 6240 7716 8025

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/inode.c