On Wed, Jul 2, 2014 at 12:49 AM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 01/07/2014 16:49, Ming Lei ha scritto: > >> Let me provide some data when running randread(bs 4k, libaio) >> from VM for 10sec: >> >> 1), qemu.git/master >> - write(): 731K >> - rt_sigprocmask(): 417K >> - read(): 21K >> - ppoll(): 10K >> - io_submit(): 5K >> - io_getevents(): 4K >> >> 2), qemu 2.0 >> - write(): 9K >> - read(): 28K >> - ppoll(): 16K >> - io_submit(): 12K >> - io_getevents(): 10K >> >>> > The sigprocmask can probably be optimized away since the thread's >>> > signal mask remains unchanged most of the time. >>> > >>> > I'm not sure what is causing the write(). >> >> I am investigating it... > > > I would guess sigprocmask is getcontext (from qemu_coroutine_new) and write > is aio_notify (from qemu_bh_schedule).
Yes, the write is on ctx->notifier. > > Both can be eliminated by introducing a fast path in bdrv_aio_{read,write}v, > that bypasses coroutines in the common case of no I/O throttling, no > copy-on-write, etc. Thanks, -- Ming Lei