[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers |
Date: |
Thu, 2 Mar 2017 16:32:08 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 02/03/2017 15:49, Cornelia Huck wrote:
> On Thu, 2 Mar 2017 14:04:22 +0100
> Halil Pasic <address@hidden> wrote:
>
>> diff --git a/hw/block/dataplane/virtio-blk.c
>> b/hw/block/dataplane/virtio-blk.c
>> index 5556f0e..13dd14d 100644
>> --- a/hw/block/dataplane/virtio-blk.c
>> +++ b/hw/block/dataplane/virtio-blk.c
>> @@ -258,9 +258,16 @@ void virtio_blk_data_plane_stop(VirtIODevice *vdev)
>> virtio_queue_aio_set_host_notifier_handler(vq, s->ctx, NULL);
>> }
>>
>> - /* Drain and switch bs back to the QEMU main loop */
>> + /* Drain and switch bs back to the QEMU main loop. After drain, the
>> + * device will not submit (nor comple) any requests until dataplane
>
> s/comple/complete/
>
>> + * starts again.
>> + */
>> blk_set_aio_context(s->conf->conf.blk, qemu_get_aio_context());
>>
>> + /* Notify guest before the guest notifiers get cleaned up */
>> + qemu_bh_cancel(s->bh);
>> + notify_guest_bh(s);
>> +
>
> Hm... does virtio-scsi dataplane need a similar treatment? Or am I
> missing something?
No, the BH optimization is specific to virtio-blk. Thanks for the patch
Halil!
Paolo
>> aio_context_release(s->ctx);
>>
>> for (i = 0; i < nvqs; i++) {
>
- [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers, Halil Pasic, 2017/03/02
- Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers, Cornelia Huck, 2017/03/02
- Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers, Halil Pasic, 2017/03/02
- Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers, Paolo Bonzini, 2017/03/02
- Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers, Halil Pasic, 2017/03/03
- Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers, Paolo Bonzini, 2017/03/06
- Re: [Qemu-devel] [PATCH 1/1] virtio-blk: fix race on guest notifiers, Halil Pasic, 2017/03/06