qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]