Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-13 Thread Paolo Bonzini
On 13/02/2015 13:42, Fam Zheng wrote: > OK, thanks for elaborating. I think for the sake of single IO thread support > we > already started, the best option now is to go as you suggested - move > bdrv_set_aio_context to virtio_scsi_dataplane_start and hotplug callbacks. Yes, no doubt the bug ha

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-13 Thread Fam Zheng
On Fri, 02/13 11:38, Paolo Bonzini wrote: > > > On 13/02/2015 11:29, Fam Zheng wrote: > > I think we should avoid duplicate everything on both virtio-blk and > > virtio-scsi, so they will have differences. > > True, but there are also similarities. virtio-blk can also do per-VQ > iothreads > >

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-13 Thread Paolo Bonzini
On 13/02/2015 11:29, Fam Zheng wrote: > I think we should avoid duplicate everything on both virtio-blk and > virtio-scsi, so they will have differences. True, but there are also similarities. virtio-blk can also do per-VQ iothreads > Why do you think Per VQ iothread is far away? Because per-

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-13 Thread Fam Zheng
On Fri, 02/13 10:38, Paolo Bonzini wrote: > > > On 13/02/2015 02:21, Fam Zheng wrote: > >> 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 m

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-13 Thread Paolo Bonzini
On 13/02/2015 02:21, Fam Zheng wrote: >> 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 i

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-12 Thread Fam Zheng
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

Re: [Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-12 Thread Paolo Bonzini
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 reas

[Qemu-devel] [PATCH 3/3] virtio-scsi-dataplane: Use main thread BH to set BDS' aio context

2015-02-11 Thread Fam Zheng
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