[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 09/17] dataplane: enable selective bypassing coro
From: |
Ming Lei |
Subject: |
[Qemu-devel] [PATCH v1 09/17] dataplane: enable selective bypassing coroutine |
Date: |
Tue, 5 Aug 2014 11:33:10 +0800 |
This patch enables selective bypassing for the
coroutine in bdrv_co_aio_rw_vector() if the image
format is raw.
With this patch, ~10% throughput improvement for raw image 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 c9a8cc2..a0732e3 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -30,6 +30,7 @@ struct VirtIOBlockDataPlane {
bool started;
bool starting;
bool stopping;
+ bool raw_format;
VirtIOBlkConf *blk;
@@ -199,6 +200,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;
}
@@ -272,6 +275,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) {
+ bdrv_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);
@@ -303,6 +310,9 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)
vblk->obj_pool = NULL;
+ if (s->raw_format) {
+ bdrv_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 v1 02/17] dataplane: use object pool to speed up allocation for virtio blk request, (continued)
- [Qemu-devel] [PATCH v1 02/17] dataplane: use object pool to speed up allocation for virtio blk request, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 03/17] qemu coroutine: support bypass mode, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 04/17] block: prepare for supporting selective bypass coroutine, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 05/17] garbage collector: introduced for support of bypass coroutine, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 06/17] block: introduce bdrv_co_can_bypass_co, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 07/17] block: support to bypass qemu coroutinue, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 08/17] Revert "raw-posix: drop raw_get_aio_fd() since it is no longer used", Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 09/17] dataplane: enable selective bypassing coroutine,
Ming Lei <=
- [Qemu-devel] [PATCH v1 10/17] linux-aio: fix submit aio as a batch, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 11/17] linux-aio: handling -EAGAIN for !s->io_q.plugged case, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 12/17] linux-aio: increase max event to 256, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 13/17] linux-aio: remove 'node' from 'struct qemu_laiocb', Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 14/17] hw/virtio/virtio-blk.h: introduce VIRTIO_BLK_F_MQ, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 15/17] virtio-blk: support multi queue for non-dataplane, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 16/17] virtio-blk: dataplane: support multi virtqueue, Ming Lei, 2014/08/04
- [Qemu-devel] [PATCH v1 17/17] hw/virtio-pci: introduce num_queues property, Ming Lei, 2014/08/04
- Re: [Qemu-devel] [PATCH v1 00/17] dataplane: optimization and multi virtqueue support, Stefan Hajnoczi, 2014/08/05