From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1eBF-0002CW-Jg for qemu-devel@nongnu.org; Mon, 30 Jun 2014 12:11:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1eB9-0007VM-Lq for qemu-devel@nongnu.org; Mon, 30 Jun 2014 12:11:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1eB9-0007V9-C4 for qemu-devel@nongnu.org; Mon, 30 Jun 2014 12:11:39 -0400 Message-ID: <53B18C32.4050809@redhat.com> Date: Mon, 30 Jun 2014 18:11:30 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1404143260-9368-1-git-send-email-ming.lei@canonical.com> <1404143260-9368-4-git-send-email-ming.lei@canonical.com> In-Reply-To: <1404143260-9368-4-git-send-email-ming.lei@canonical.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v1 3/3] dataplane: submit I/O at batch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ming Lei , Peter Maydell , qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Kevin Wolf , Fam Zheng , "Michael S. Tsirkin" Il 30/06/2014 17:47, Ming Lei ha scritto: > Before commit 580b6b2aa2(dataplane: use the Qemu block > layer for I/O), dataplane for virtio-blk submits block > I/O at batch. > > This commit 580b6b2aa2 replaces the custom linux AIO > implementation(including I/O batch) with Qemu block > layer, but this commit causes ~40% throughput regression > on virtio-blk performance, and removing submitting I/O > at batch is one of the cause. > > This patch applys the new introduced bdrv_io_plug() and > bdrv_io_unplug() interfaces to support submitting I/O > at batch for Qemu block layer, and in my test, the change > can improve thoughput by ~30% with 'aio=native'. > > Following my fio test script: > > [global] > direct=1 > size=4G > bsrange=4k-4k > timeout=40 > numjobs=4 > ioengine=libaio > iodepth=64 > filename=/dev/vdc > group_reporting=1 > > [f] > rw=randread > > Result on one of my small machine(host: x86_64, 2cores, 4thread, guest: 4cores): > - qemu master: 59K IOPS > - qemu master with these patches: 81K IOPS > - 2.0.0 release(dataplane using custom linux aio): 104K IOPS > > Signed-off-by: Ming Lei > --- > hw/block/dataplane/virtio-blk.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c > index c10b7b7..8fefcce 100644 > --- a/hw/block/dataplane/virtio-blk.c > +++ b/hw/block/dataplane/virtio-blk.c > @@ -289,6 +289,7 @@ static void handle_notify(EventNotifier *e) > int ret; > > event_notifier_test_and_clear(&s->host_notifier); > + bdrv_io_plug(s->blk->conf.bs); > for (;;) { > /* Disable guest->host notifies to avoid unnecessary vmexits */ > vring_disable_notification(s->vdev, &s->vring); > @@ -322,6 +323,7 @@ static void handle_notify(EventNotifier *e) > break; > } > } > + bdrv_io_unplug(s->blk->conf.bs); > } > > /* Context: QEMU global mutex held */ > Reviewed-by: Paolo Bonzini but please add it to the non-dataplane path as well, and to virtio-scsi. Paolo