On Wed, Jun 15, 2016 at 01:16:42PM +0200, Kevin Wolf wrote: > linux-aio uses a BH in order to make sure that the remaining completions > are processed even in nested event loops of completion callbacks in > order to avoid deadlocks. > > There is no need, however, to have the BH overhead for the first call > into qemu_laio_completion_bh() or after all pending completions have > already been processed. Therefore, this patch calls directly into > qemu_laio_completion_bh() in qemu_laio_completion_cb() and cancels > the BH after qemu_laio_completion_bh() has processed all pending > completions. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block/linux-aio.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-)
I ran 4 x iodepth=16 random 4KB read I/O benchmarks. There might be an improvement but it's within the error margin. My benchmarking setup can be noisy... Anyway, this patch doesn't hurt performance. Guest and host are RHEL 7.2. $ ./analyze.py runs/ Name IOPS Error linux-aio-bh-optimizations-ccb9dc1 12942616.0 ± 16.83% linux-aio-bh-optimizations-ccb9dc1-2 13833110.4 ± 4.74% linux-aio-bh-optimizations-off-23b0d9f 13303981.4 ± 2.21% qemu-system-x86_64 -pidfile qemu.pid -daemonize \ -machine accel=kvm -cpu host \ -smp 4 -m 1024 \ -netdev user,id=netdev0,hostfwd=tcp::2222-:22 \ -object iothread,id=iothread0 \ -device virtio-net-pci,netdev=netdev0 \ -drive if=none,id=drive0,file=/var/lib/libvirt/images/test.img,format=raw,aio=native,cache=none \ -device virtio-blk-pci,drive=drive0 \ -drive if=none,id=drive1,file=/dev/nullb0,format=raw,aio=native,cache=none \ -device virtio-blk-pci,drive=drive1 \ -display none $ cat fio.job [global] filename=/dev/vdb ioengine=libaio direct=1 runtime=60 ramp_time=5 gtod_reduce=1 [job1] numjobs=4 iodepth=16 rw=randread bs=4K Stefan
signature.asc
Description: PGP signature