[Top][All Lists]

[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: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context
Date: Thu, 12 Feb 2015 15:29:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

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. :)


reply via email to

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