[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 05/14] dataplane: enable selective bypassing cor
From: |
Ming Lei |
Subject: |
[Qemu-devel] [PATCH RFC 05/14] dataplane: enable selective bypassing coroutine |
Date: |
Thu, 17 Jul 2014 00:31:12 +0800 |
This patch enables selective bypassing for the
coroutine in bdrv_co_aio_rw_vector() if the image
format is raw.
With this patch, ~16% thoughput improvement can
be observed in my laptop based VM test, and ~7%
improvement is observed in the VM based on server.
Signed-off-by: Ming Lei <address@hidden>
---
hw/block/dataplane/virtio-blk.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index d6ba65c..2093e4a 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -28,6 +28,7 @@ struct VirtIOBlockDataPlane {
bool started;
bool starting;
bool stopping;
+ bool raw_format;
VirtIOBlkConf *blk;
@@ -193,6 +194,8 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev,
VirtIOBlkConf *blk,
error_setg(&s->blocker, "block device is in use by data plane");
bdrv_op_block_all(blk->conf.bs, s->blocker);
+ s->raw_format = (raw_get_aio_fd(blk->conf.bs) >= 0);
+
*dataplane = s;
}
@@ -262,6 +265,10 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s)
/* Kick right away to begin processing requests already in vring */
event_notifier_set(virtio_queue_get_host_notifier(vq));
+ if (s->raw_format) {
+ qemu_aio_set_bypass_co(s->ctx, true);
+ }
+
/* Get this show started by hooking up our callbacks */
aio_context_acquire(s->ctx);
aio_set_event_notifier(s->ctx, &s->host_notifier, handle_notify);
@@ -291,6 +298,9 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)
aio_context_release(s->ctx);
+ if (s->raw_format) {
+ qemu_aio_set_bypass_co(s->ctx, false);
+ }
/* Sync vring state back to virtqueue so that non-dataplane request
* processing can continue when we disable the host notifier below.
*/
--
1.7.9.5
- [Qemu-devel] [PATCH RFC 00/14] dataplane: performance optimization and multi virtqueue, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 01/14] qemu coroutine: support bypass mode, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 02/14] qemu aio: prepare for supporting selective bypass coroutine, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 03/14] block: support to bypass qemu coroutinue, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 04/14] Revert "raw-posix: drop raw_get_aio_fd() since it is no longer used", Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 05/14] dataplane: enable selective bypassing coroutine,
Ming Lei <=
- [Qemu-devel] [PATCH RFC 06/14] qemu/obj_pool.h: introduce object allocation pool, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 07/14] dataplane: use object pool to speed up allocation for virtio blk request, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 08/14] linux-aio: fix submit aio as a batch, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 09/14] linux-aio: increase max event to 256, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 10/14] linux-aio: remove 'node' from 'struct qemu_laiocb', Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 11/14] hw/virtio-pci: introduce num_queues property, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 12/14] hw/virtio/virtio-blk.h: introduce VIRTIO_BLK_F_MQ, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 13/14] hw/block/virtio-blk: create num_queues vqs if dataplane is enabled, Ming Lei, 2014/07/16
- [Qemu-devel] [PATCH RFC 14/14] dataplane: virtio-blk: support mutlti virtqueue, Ming Lei, 2014/07/16