[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 6/9] virtio-blk: use aio handler for data plane
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH 6/9] virtio-blk: use aio handler for data plane |
Date: |
Wed, 30 Mar 2016 17:25:56 +0200 |
On Wed, 30 Mar 2016 14:48:05 +0200
Paolo Bonzini <address@hidden> wrote:
> From: "Michael S. Tsirkin" <address@hidden>
>
> In addition to handling IO in vcpu thread and in io thread, dataplane
> introduces yet another mode: handling it by aio.
>
> This reuses the same handler as previous modes, which triggers races as
> these were not designed to be reentrant.
>
> Use a separate handler just for aio, and disable regular handlers when
> dataplane is active.
>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> hw/block/dataplane/virtio-blk.c | 13 +++++++++++++
> hw/block/virtio-blk.c | 27 +++++++++++++++++----------
> include/hw/virtio/virtio-blk.h | 2 ++
> 3 files changed, 32 insertions(+), 10 deletions(-)
>
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index 77221c1..47ad9ed 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -577,20 +577,11 @@ void virtio_blk_handle_request(VirtIOBlockReq *req,
> MultiReqBuffer *mrb)
> }
> }
>
> -static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq)
> +void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq)
> {
> - VirtIOBlock *s = VIRTIO_BLK(vdev);
> VirtIOBlockReq *req;
> MultiReqBuffer mrb = {};
>
> - /* Some guests kick before setting VIRTIO_CONFIG_S_DRIVER_OK so start
> - * dataplane here instead of waiting for .set_status().
> - */
> - if (s->dataplane && !s->dataplane_started) {
> - virtio_blk_data_plane_start(s->dataplane);
> - return;
> - }
> -
> assert(atomic_fetch_inc(&s->reentrancy_test) == 0);
Hm, based on wrong branch?
> blk_io_plug(s->blk);
>
- Re: [Qemu-devel] [PATCH 1/9] virtio-dataplane: pass assign=true to virtio_queue_aio_set_host_notifier_handler, (continued)
- [Qemu-devel] [PATCH 4/9] virtio-scsi: fix disabled mode, Paolo Bonzini, 2016/03/30
- [Qemu-devel] [PATCH 5/9] virtio: add aio handler, Paolo Bonzini, 2016/03/30
- [Qemu-devel] [PATCH 2/9] virtio: make virtio_queue_notify_vq static, Paolo Bonzini, 2016/03/30
- [Qemu-devel] [PATCH 6/9] virtio-blk: use aio handler for data plane, Paolo Bonzini, 2016/03/30
- Re: [Qemu-devel] [PATCH 6/9] virtio-blk: use aio handler for data plane,
Cornelia Huck <=
- [Qemu-devel] [PATCH 7/9] virtio-scsi: use aio handler for data plane, Paolo Bonzini, 2016/03/30
- [Qemu-devel] [PATCH 8/9] virtio: merge virtio_queue_aio_set_host_notifier_handler with virtio_queue_set_aio, Paolo Bonzini, 2016/03/30
- [Qemu-devel] [PATCH 9/9] virtio: remove starting/stopping checks, Paolo Bonzini, 2016/03/30