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 missing the obvious. :) > > > > Per VQ IOThread stills needs it, in the case that guest switches the VQ of a > > disk on the fly. > > Per VQ iothread is far away though. Multiqueue aims at parallelizing > accesses *to the same disk from different CPUs*, not at parallelizing > accesses to different disks. As long as bdrv_set_aio_context does > bdrv_drain_all, something has to change for multiqueue dataplane: either > stop using bdrv_set_aio_context, or stop doing bdrv_drain_all. > > In either case, the changes are large enough that we shouldn't code for > a case that doesn't exist yet. > > In addition, making the code more similar for virtio-blk and virtio-scsi > dataplane is good, because the same changes can apply to both in the future.
I think we should avoid duplicate everything on both virtio-blk and virtio-scsi, so they will have differences. Why do you think Per VQ iothread is far away? Limiting to 1 thread for the whole scsi bus doesn't sound ultimate solution for me. I think it's not harder than the MMIO safety work we have, and also somehow independent to it. But yes, stop using bdrv_set_aio_context will be the other way to make it right, just harder to do. Fam