qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [Qemu-devel] [regression] dataplane: throughout -40% by commit 580b6b2aa2
Date: Mon, 30 Jun 2014 10:08:50 +0200	[thread overview]
Message-ID: <20140630080850.GB30969@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <CACVXFVMYQ62tREcPDs0rh834BuKtygYqLJic71cmuTYjFzgCJg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2262 bytes --]

On Sat, Jun 28, 2014 at 05:58:58PM +0800, Ming Lei wrote:
> On Sat, Jun 28, 2014 at 5:51 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Il 27/06/2014 20:01, Ming Lei ha scritto:
> >
> >> I just implemented plug&unplug based batching, and it is working now.
> >> But throughout still has no obvious improvement.
> >>
> >> Looks loading in IOthread is a bit low, so I am wondering if there is
> >> block point caused by Qemu QEMU block layer.
> >
> >
> > What does perf say?  Also, you can try using the QEMU trace subsystem and
> > see where the latency goes.
> 
> Follows some test result against 8589744aaf07b62 of
> upstream qemu, and the test is done on my 2core(4thread)
> laptop:
> 
> 1, with my draft batch patches[1](only linux-aio supported now)
> - throughput: +16% compared qemu upstream
> - average time spent by handle_notify(): 310us
> - average time between two handle_notify(): 1591us
> (this time reflects latency of handling host_notifier)

16% is still a worthwhile improvement.  I guess batching only benefits
aio=native since the threadpool ought to do better when it receives
requests as soon as possible.

Patch or an RFC would be welcome.

> 2, same tests on 2.0.0 release(use custom Linux AIO)
> - average time spent by handle_notify(): 68us
> - average time between calling two handle_notify(): 269us
> (this time reflects latency of handling host_notifier)
> 
> From above tests, looks root cause is late handling notify, and
> qemu block layer becomes 4times slower than previous custom
> linux aio taken by dataplane.

Try:
$ perf record -e syscalls:* --tid <iothread-tid>
^C
$ perf script # shows the trace log

The difference between syscalls in QEMU 2.0 and qemu.git/master could
reveal the problem.

Using perf you can also trace ioeventfd signalling in the host kernel
and compare against the QEMU handle_notify entry/return.  It may be
easiest to use the ftrace_marker tracing backing in QEMU so the trace is
unified with the host kernel trace (./configure
--enable-trace-backend=ftrace and see the ftrace section in QEMU
docs/tracing.txt).

This way you can see whether the ioeventfd signal -> handle_notify()
entry increased or something else is going on.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-06-30  8:09 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 15:14 [Qemu-devel] [regression] dataplane: throughout -40% by commit 580b6b2aa2 Ming Lei
2014-06-26 15:29 ` Paolo Bonzini
2014-06-26 15:37   ` Ming Lei
2014-06-26 15:43     ` Paolo Bonzini
2014-06-26 15:47       ` Ming Lei
2014-06-26 15:57         ` Paolo Bonzini
2014-06-27  1:15           ` Ming Lei
2014-06-27  4:59             ` Paolo Bonzini
2014-06-27  6:23               ` Kevin Wolf
2014-06-27  7:35                 ` Paolo Bonzini
2014-06-27 12:35                 ` Ming Lei
2014-06-27  7:57               ` Ming Lei
2014-06-27 12:01 ` Stefan Hajnoczi
2014-06-27 12:21   ` Kevin Wolf
2014-06-27 14:50     ` Stefan Hajnoczi
2014-06-27 18:01   ` Ming Lei
2014-06-27 21:51     ` Paolo Bonzini
2014-06-28  9:58       ` Ming Lei
2014-06-30  8:08         ` Stefan Hajnoczi [this message]
2014-06-30  8:27           ` Ming Lei
2014-07-01 13:53           ` Ming Lei
2014-07-01 14:31             ` Stefan Hajnoczi
2014-07-01 14:49               ` Ming Lei
2014-07-01 16:49                 ` Paolo Bonzini
2014-07-02  0:48                   ` Ming Lei
2014-07-02  8:54                   ` Stefan Hajnoczi
2014-07-02  9:13                     ` Paolo Bonzini
2014-07-02  9:39                       ` Kevin Wolf
2014-07-02  9:48                         ` Paolo Bonzini
2014-07-02 10:01                           ` Kevin Wolf
2014-07-02 10:23                             ` Paolo Bonzini
2014-07-02 15:45                     ` Ming Lei
2014-07-02 16:13                       ` Ming Lei
2014-07-02 16:23                         ` Paolo Bonzini
2014-07-02 16:27                           ` Ming Lei
2014-07-02 16:38                             ` Paolo Bonzini
2014-07-02 16:41                               ` Ming Lei
2014-07-02 16:21                       ` Paolo Bonzini
2014-07-03  4:54                         ` Ming Lei
2014-07-03 10:29                           ` Paolo Bonzini
2014-07-03 11:50                             ` Ming Lei
2014-07-03 11:56                               ` Paolo Bonzini
2014-07-03 12:09                                 ` 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=20140630080850.GB30969@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tom.leiming@gmail.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).