On Mon, Jun 30, 2014 at 8:32 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 30/06/2014 14:16, Ming Lei ha scritto: > >> I added the io queue into AioContext because the io queue can only >> be used in the attached context(or thread), that said the io queue has to >> be put into per context instance. > > > It doesn't *have* to be per-thread.
For linux aio, because no thread pool is involved, I think AioContext is still per thread if I understand correctly. > > It is certainly simplest if you make it per-io_context_t, but this in the > current code means making it per-BlockDriverState and putting it in > block/linux-aio.c. OK, I will put it into qemu_laio_state first, but change to generic block layer is still needed because at least plug/unplug interfaces should be provided from block layer. > > >> OK, I will not consider backing_hd case in v1, also the patchset will >> not only improve dataplane, and other devices should benefit from >> it too. >> >> These patches themselves should be simple, and most of code are >> add-only, if bdrv_io_plug()/bdrv_io_unplug() isn't used, they are very >> close >> to noop. >> >> I just wrote a draft patch to apply the mechanism on virtio-scsi, and >> the improvement is obvious. > > > I certainly agree. However, we have to also consider that we're close to > releasing 2.1. Thanks, -- Ming Lei