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 0/3] block: introduce submit I/O at batch
Date: Mon, 30 Jun 2014 13:10:00 +0200	[thread overview]
Message-ID: <53B14588.5040807@redhat.com> (raw)
In-Reply-To: <1404121756-14544-1-git-send-email-ming.lei@canonical.com>

Il 30/06/2014 11:49, Ming Lei ha scritto:
> Hi,
>
> The commit 580b6b2aa2(dataplane: use the QEMU block layer for I/O)
> introduces ~40% throughput regression on virtio-blk dataplane, and
> one of causes is that submitting I/O at batch is removed.
>
> This patchset trys to introduce this mechanism on block, at least,
> linux-aio can benefit from that.
>
> With these patches, it is observed that thoughout on virtio-blk
> dataplane can be improved a lot, see data in commit log of patch
> 3/3.
>
> It should be possible to apply the batch mechanism to other devices
> (such as virtio-scsi) too.

The basic idea of the code is great, however I do not think it is 
necessary to add the logic in AioContext.  You are right that io_submit 
supports multiple I/O, but right now we have one io_context_t per 
BlockDriverState so it is somewhat premature.  Note that AioContext in 
QEMU means something else than io_context_t.

I don't think it's necessary to walk backing_hd too (especially because 
we're close to release and this cannot be a regression---dataplane in 
2.0 didn't support backing files at all!).  We need to keep the patches 
as simple as possible.

You can just add bdrv_plug/bdrv_unplug callbacks to block/linux-aio.c 
and, in block.c, something like

     BlockDriver *drv = bs->drv;
     if (drv && drv->bdrv_plug) {
         drv->bdrv_plug(bdrv);
     } else if (bs->file) {
         bdrv_plug(bs->file);
     }

and place all the queuing logic in linux-aio.c.  It should be obvious to 
the reviewer that the patch only affects dataplane.

(Also, note that QEMU doesn't use __ as the prefix for internal function).

Thanks for the patch!

Paolo

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30  9:49 [Qemu-devel] [PATCH 0/3] block: introduce submit I/O at batch Ming Lei
2014-06-30  9:49 ` [Qemu-devel] [PATCH 1/3] block: introduce IO queue APIs Ming Lei
2014-06-30  9:49 ` [Qemu-devel] [PATCH 2/3] block: linux-aio: support submit io_queue Ming Lei
2014-06-30  9:49 ` [Qemu-devel] [PATCH 3/3] dataplane: submit I/O at batch Ming Lei
2014-06-30 11:10 ` Paolo Bonzini [this message]
2014-06-30 12:16   ` [Qemu-devel] [PATCH 0/3] block: introduce " Ming Lei
2014-06-30 12:32     ` Paolo Bonzini
2014-06-30 12:49       ` Ming Lei

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=53B14588.5040807@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.