All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Ming Lei <ming.lei@canonical.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v1 3/3] dataplane: submit I/O at batch
Date: Mon, 30 Jun 2014 18:11:30 +0200	[thread overview]
Message-ID: <53B18C32.4050809@redhat.com> (raw)
In-Reply-To: <1404143260-9368-4-git-send-email-ming.lei@canonical.com>

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 <ming.lei@canonical.com>
> ---
>  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 <pbonzini@redhat.com>

but please add it to the non-dataplane path as well, and to virtio-scsi.

Paolo

      reply	other threads:[~2014-06-30 16:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 15:47 [Qemu-devel] [PATCH v1 0/3] linux-aio: introduce submit I/O at batch Ming Lei
2014-06-30 15:47 ` [Qemu-devel] [PATCH v1 1/3] block: block: introduce bdrv_io_plug() and bdrv_io_unplug() Ming Lei
2014-06-30 16:10   ` Paolo Bonzini
2014-06-30 16:15     ` Ming Lei
2014-06-30 16:18       ` Paolo Bonzini
2014-06-30 16:29         ` Ming Lei
2014-06-30 15:47 ` [Qemu-devel] [PATCH v1 2/3] linux-aio: implement io plug and unplug Ming Lei
2014-06-30 17:31   ` Paolo Bonzini
2014-07-01  1:05     ` Ming Lei
2014-07-01  6:16       ` Paolo Bonzini
2014-06-30 15:47 ` [Qemu-devel] [PATCH v1 3/3] dataplane: submit I/O at batch Ming Lei
2014-06-30 16:11   ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B18C32.4050809@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.