qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Ming Lei <ming.lei@canonical.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	pl@kamp.de, qemu-devel <qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines
Date: Fri, 28 Nov 2014 11:06:25 +0100	[thread overview]
Message-ID: <20141128100625.GB4035@noname.redhat.com> (raw)
In-Reply-To: <CACVXFVPwXT_3LkSeMRA7j+Mj7vnFF+-U+NWvjSNsyVPohhoLZA@mail.gmail.com>

Am 28.11.2014 um 03:59 hat Ming Lei geschrieben:
> Hi Kevin,
> 
> On Wed, Nov 26, 2014 at 10:46 PM, Kevin Wolf <kwolf@redhat.com> wrote:
> > This improves the performance of requests because an ACB doesn't need to
> > be allocated on the heap any more. It also makes the code nicer and
> > smaller.
> 
> I am not sure it is good way for linux aio optimization:
> 
> - for raw image with some constraint, coroutine can be avoided since
> io_submit() won't sleep most of times
> 
> - handling one time coroutine takes much time than handling malloc,
> memset and free on small buffer, following the test data:
> 
>          --   241ns per coroutine
>          --   61ns per (malloc, memset, free for 128bytes)

Please finally stop making comparisons between completely unrelated
things and trying to make a case against coroutines out of it. It simply
doesn't make any sense.

The truth is that in the 'qemu-img bench' case as well as in the highest
performing VM setup for Peter and me, the practically existing coroutine
based git branches perform better then the practically existing bypass
branches. If you think that theoretically the bypass branches must be
better, show us the patches and benchmarks.

If you can't, let's merge the coroutine improvements (which improve
more than just the case of raw images using no block layer features,
including cases that benefit the average user) and be done.

> I still think we should figure out a fast path to avoid cocourinte
> for linux-aio with raw image, otherwise it can't scale well for high
> IOPS device.
> 
> Also we can use simple buf pool to avoid the dynamic allocation
> easily, can't we?

Yes, the change to g_slice_alloc() was a bad move performance-wise.

> > As a side effect, the codepath taken by aio=threads is changed to use
> > paio_submit_co(). This doesn't change the performance at this point.
> >
> > Results of qemu-img bench -t none -c 10000000 [-n] /dev/loop0:
> >
> >       |      aio=native       |     aio=threads
> >       | before   | with patch | before   | with patch
> > ------+----------+------------+----------+------------
> > run 1 | 29.921s  | 26.932s    | 35.286s  | 35.447s
> > run 2 | 29.793s  | 26.252s    | 35.276s  | 35.111s
> > run 3 | 30.186s  | 27.114s    | 35.042s  | 34.921s
> > run 4 | 30.425s  | 26.600s    | 35.169s  | 34.968s
> > run 5 | 30.041s  | 26.263s    | 35.224s  | 35.000s
> >
> > TODO: Do some more serious benchmarking in VMs with less variance.
> > Results of a quick fio run are vaguely positive.
> 
> I will do the test with Paolo's fast path approach under
> VM I/O situation.

Currently, the best thing to compare it against is probably Peter's git
branch at https://github.com/plieven/qemu.git perf_master2. This patch
is only a first step in a whole series of possible optimisations.

Kevin

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

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 14:46 [Qemu-devel] [RFC PATCH 0/3] linux-aio: Convert to coroutines Kevin Wolf
2014-11-26 14:46 ` [Qemu-devel] [RFC PATCH 1/3] qemu-img bench Kevin Wolf
2014-11-28 11:49   ` Stefan Hajnoczi
2014-11-28 12:19     ` Kevin Wolf
2014-12-01 11:15       ` Stefan Hajnoczi
2014-11-26 14:46 ` [Qemu-devel] [RFC PATCH 2/3] raw-posix: Convert Linux AIO submission to coroutines Kevin Wolf
2014-11-27  9:50   ` Peter Lieven
2014-11-28 12:57     ` Kevin Wolf
2014-11-28 13:44       ` Kevin Wolf
2014-11-28  2:59   ` Ming Lei
2014-11-28  7:33     ` Markus Armbruster
2014-11-28  8:12       ` Ming Lei
2014-11-28  8:59         ` Markus Armbruster
2014-11-28  9:15           ` Ming Lei
2014-11-28  9:44     ` Paolo Bonzini
2014-11-28 10:06     ` Kevin Wolf [this message]
2014-11-26 14:46 ` [Qemu-devel] [RFC PATCH 3/3] linux-aio: Don't reenter request coroutine recursively Kevin Wolf
2014-12-04 14:37   ` Kevin Wolf
2014-12-04 15:22     ` Ming Lei
2014-12-04 15:39       ` Kevin Wolf
2014-12-04 15:45         ` 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=20141128100625.GB4035@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=ming.lei@canonical.com \
    --cc=pbonzini@redhat.com \
    --cc=pl@kamp.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).