[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH t
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context |
Date: |
Fri, 13 Feb 2015 09:21:29 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, 02/12 15:29, Paolo Bonzini wrote:
>
>
> On 12/02/2015 06:21, Fam Zheng wrote:
> > Before processing a request, virtio-scsi dataplane will check if the
> > backend runs on the same context with it. If not, it has to be moved,
> > with bdrv_set_aio_context.
> >
> > However this function is unsafe to be called from IOThread outside BQL.
> > The reason is that it calls bdrv_drain_all(), to acquire and drain all
> > existing BDS. Therefore there is a deadlock problem.
> >
> > Fix it by offloading the bdrv_set_aio_context to main loop thread,
> > through a BH (#1). This main loop BH will set the context, then notify
> > the calling thread with another BH (#2). In BH (#2), we can continue the
> > virtio-scsi request processing.
> >
> > A queue is added to VirtIOSCSI for tracking the pending requests, so in
> > virtio_scsi_dataplane_stop, we have to drain them for migration.
> >
> > Signed-off-by: Fam Zheng <address@hidden>
>
> Could you just do set_aio_context for all devices when starting
> dataplane? For example with a new scsi_device_set_aio_context function
> (and a new method in SCSIDeviceClass).
>
> Maybe I'm missing the obvious. :)
>
Per VQ IOThread stills needs it, in the case that guest switches the VQ of a
disk on the fly.
Fam
- [Qemu-devel] [PATCH 0/3] virtio-scsi: Fix unsafe bdrv_set_aio_context calls, Fam Zheng, 2015/02/12
- [Qemu-devel] [PATCH 2/3] virtio-scsi: Deduplicate cmd queue handling code of dataplane, Fam Zheng, 2015/02/12
- [Qemu-devel] [PATCH 1/3] block: Forbid bdrv_set_aio_context outside BQL, Fam Zheng, 2015/02/12
- [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context, Fam Zheng, 2015/02/12
- Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context, Paolo Bonzini, 2015/02/12
- Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context,
Fam Zheng <=
- Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context, Paolo Bonzini, 2015/02/13
- Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context, Fam Zheng, 2015/02/13
- Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context, Paolo Bonzini, 2015/02/13
- Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context, Fam Zheng, 2015/02/13
- Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context, Paolo Bonzini, 2015/02/13