[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 5/9] virtio: add aio handler
From: |
Cornelia Huck |
Subject: |
Re: [Qemu-devel] [PATCH 5/9] virtio: add aio handler |
Date: |
Wed, 30 Mar 2016 16:55:15 +0200 |
On Wed, 30 Mar 2016 14:48:04 +0200
Paolo Bonzini <address@hidden> wrote:
> From: "Michael S. Tsirkin" <address@hidden>
>
> In addition to handling IO in vcpu thread and
> in io thread, blk 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.
>
> As a temporary fix, add a separate handler just for aio, this will make
> it possible to disable regular handlers when dataplane is active.
>
> Signed-off-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> hw/virtio/virtio.c | 36 ++++++++++++++++++++++++++++++++----
> include/hw/virtio/virtio.h | 3 +++
> 2 files changed, 35 insertions(+), 4 deletions(-)
>
> @@ -1791,14 +1811,22 @@ void
> virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx,
> {
> if (assign && set_handler) {
> aio_set_event_notifier(ctx, &vq->host_notifier, true,
> - virtio_queue_host_notifier_read);
> + virtio_queue_host_notifier_aio_read);
> } else {
> aio_set_event_notifier(ctx, &vq->host_notifier, true, NULL);
> }
> if (!assign) {
> /* Test and clear notifier before after disabling event,
> * in case poll callback didn't have time to run. */
> - virtio_queue_host_notifier_read(&vq->host_notifier);
> + virtio_queue_host_notifier_aio_read(&vq->host_notifier);
Is this function ever called with assign==false anymore after patch 1?
> + }
> +}
- [Qemu-devel] [PATCH 3/9] virtio-blk: fix disabled mode, (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
- Re: [Qemu-devel] [PATCH 5/9] virtio: add aio handler,
Cornelia Huck <=
- [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
- [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