[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL for-2.1 10/11] dataplane: submit I/O as a batch
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL for-2.1 10/11] dataplane: submit I/O as a batch |
Date: |
Mon, 7 Jul 2014 14:28:37 +0200 |
From: Ming Lei <address@hidden>
Before commit 580b6b2aa2(dataplane: use the QEMU block
layer for I/O), dataplane for virtio-blk submits block
I/O as a batch.
This commit 580b6b2aa2 replaces the custom linux AIO
implementation(including submit I/O as a batch) with QEMU
block layer, but this commit causes ~40% throughput regression
on virtio-blk performance, and removing submitting I/O
as a batch is one of the causes.
This patch applies the newly introduced bdrv_io_plug() and
bdrv_io_unplug() interfaces to support submitting I/O
at batch for Qemu block layer, and in my test, the change
can improve throughput by ~30% with 'aio=native'.
Following my fio test script:
[global]
direct=1
size=4G
bsrange=4k-4k
timeout=40
numjobs=4
ioengine=libaio
iodepth=64
filename=/dev/vdc
group_reporting=1
[f]
rw=randread
Result on one of my small machine(host: x86_64, 2cores, 4thread, guest: 4cores):
- qemu master: 65K IOPS
- qemu master with these patches: 92K IOPS
- 2.0.0 release(dataplane using custom linux aio): 104K IOPS
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Ming Lei <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/block/dataplane/virtio-blk.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 4c5ba18..4bc0729 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -84,6 +84,7 @@ static void handle_notify(EventNotifier *e)
};
event_notifier_test_and_clear(&s->host_notifier);
+ bdrv_io_plug(s->blk->conf.bs);
for (;;) {
/* Disable guest->host notifies to avoid unnecessary vmexits */
vring_disable_notification(s->vdev, &s->vring);
@@ -117,6 +118,7 @@ static void handle_notify(EventNotifier *e)
break;
}
}
+ bdrv_io_unplug(s->blk->conf.bs);
}
/* Context: QEMU global mutex held */
--
1.9.3
- [Qemu-devel] [PULL for-2.1 00/11] Block patches, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 01/11] Fix nocow typos in manpage, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 04/11] ahci.c: mask unused flags when reading size PRDT DBC, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 02/11] mirror: Fix qiov size for short requests, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 03/11] MAINTAINERS: add Stefan Hajnoczi to IDE maintainers, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 05/11] qemu-iotests: Disable Quorum testing in 041 when Quorum is not builtin, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 06/11] raw-posix: Fix raw_getlength() to always return -errno on error, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 07/11] ahci: map memory via device's address space instead of address_space_memory, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 08/11] block: block: introduce APIs for submitting IO as a batch, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 09/11] linux-aio: implement io plug, unplug and flush io queue, Stefan Hajnoczi, 2014/07/07
- [Qemu-devel] [PULL for-2.1 10/11] dataplane: submit I/O as a batch,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL for-2.1 11/11] qmp: show QOM properties in device-list-properties, Stefan Hajnoczi, 2014/07/07
- Re: [Qemu-devel] [PULL for-2.1 00/11] Block patches, Peter Maydell, 2014/07/07