[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler
From: |
Paolo Bonzini |
Subject: |
Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler |
Date: |
Mon, 18 Dec 2023 15:49:24 +0100 |
On Mon, Dec 18, 2023 at 1:41 PM Fiona Ebner <f.ebner@proxmox.com> wrote:
> I think it's because of nested drains, because when additionally
> checking that the drain count is zero and only executing the loop then,
> that issue doesn't seem to manifest
But isn't virtio_scsi_drained_end only run if bus->drain_count == 0?
if (bus->drain_count-- == 1) {
trace_scsi_bus_drained_end(bus, sdev);
if (bus->info->drained_end) {
bus->info->drained_end(bus);
}
}
Paolo
>
> > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
> > index 9c751bf296..d22c586b38 100644
> > --- a/hw/scsi/virtio-scsi.c
> > +++ b/hw/scsi/virtio-scsi.c
> > @@ -1164,9 +1164,13 @@ static void virtio_scsi_drained_end(SCSIBus *bus)
> > return;
> > }
> >
> > - for (uint32_t i = 0; i < total_queues; i++) {
> > - VirtQueue *vq = virtio_get_queue(vdev, i);
> > - virtio_queue_aio_attach_host_notifier(vq, s->ctx);
> > + if (s->bus.drain_count == 0) {
> > + for (uint32_t i = 0; i < total_queues; i++) {
> > + VirtQueue *vq = virtio_get_queue(vdev, i);
> > + virtio_queue_set_notification(vq, 1);
> > + virtio_queue_notify(vdev, i);
> > + virtio_queue_aio_attach_host_notifier(vq, s->ctx);
> > + }
> > }
> > }
> >
>
> Best Regards,
> Fiona
>
- Re: [RFC 3/3] aio-posix: call ->poll_end() when removing AioHandler, (continued)
Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler, Stefan Hajnoczi, 2023/12/13
Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler, Paolo Bonzini, 2023/12/13
Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler, Fiona Ebner, 2023/12/14