qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, Paolo Bonzini <pbonzini@redhat.com>,
	Karl Rister <krister@redhat.com>, Fam Zheng <famz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v2 0/4] aio: experimental virtio-blk polling mode
Date: Wed, 16 Nov 2016 17:46:58 +0000	[thread overview]
Message-ID: <1479318422-10979-1-git-send-email-stefanha@redhat.com> (raw)

v2:
 * Uninitialized node->deleted gone [Fam]
 * Removed 1024 polling loop iteration qemu_clock_get_ns() optimization which
   created a weird step pattern [Fam]
 * Unified with AioHandler, dropped AioPollHandler struct [Paolo]
   (actually I think Paolo had more in mind but this is the first step)
 * Only poll when all event loop resources support it [Paolo]
 * Added run_poll_handlers_begin/end trace events for perf analysis
 * Sorry, Christian, no virtqueue kick suppression yet

Recent performance investigation work done by Karl Rister shows that the
guest->host notification takes around 20 us.  This is more than the "overhead"
of QEMU itself (e.g. block layer).

One way to avoid the costly exit is to use polling instead of notification.
The main drawback of polling is that it consumes CPU resources.  In order to
benefit performance the host must have extra CPU cycles available on physical
CPUs that aren't used by the guest.

This is an experimental AioContext polling implementation.  It adds a polling
callback into the event loop.  Polling functions are implemented for virtio-blk
virtqueue guest->host kick and Linux AIO completion.

The QEMU_AIO_POLL_MAX_NS environment variable sets the number of nanoseconds to
poll before entering the usual blocking poll(2) syscall.  Try setting this
variable to the time from old request completion to new virtqueue kick.

By default no polling is done.  The QEMU_AIO_POLL_MAX_NS must be set to get any
polling!

Stefan Hajnoczi (4):
  aio: add AioPollFn and io_poll() interface
  aio: add polling mode to AioContext
  virtio: poll virtqueues for new buffers
  linux-aio: poll ring for completions

 aio-posix.c                 | 115 ++++++++++++++++++++++++++++++++++++++++++--
 async.c                     |  14 +++++-
 block/curl.c                |   8 +--
 block/iscsi.c               |   3 +-
 block/linux-aio.c           |  19 +++++++-
 block/nbd-client.c          |   8 +--
 block/nfs.c                 |   7 +--
 block/sheepdog.c            |  26 +++++-----
 block/ssh.c                 |   4 +-
 block/win32-aio.c           |   4 +-
 hw/virtio/virtio.c          |  18 ++++++-
 include/block/aio.h         |   8 ++-
 iohandler.c                 |   2 +-
 nbd/server.c                |   9 ++--
 stubs/set-fd-handler.c      |   1 +
 tests/test-aio.c            |   4 +-
 trace-events                |   4 ++
 util/event_notifier-posix.c |   2 +-
 18 files changed, 207 insertions(+), 49 deletions(-)

-- 
2.7.4

             reply	other threads:[~2016-11-16 17:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16 17:46 Stefan Hajnoczi [this message]
2016-11-16 17:46 ` [Qemu-devel] [PATCH v2 1/4] aio: add AioPollFn and io_poll() interface Stefan Hajnoczi
2016-11-17  6:14   ` Fam Zheng
2016-11-16 17:47 ` [Qemu-devel] [PATCH v2 2/4] aio: add polling mode to AioContext Stefan Hajnoczi
2016-11-16 18:14   ` Paolo Bonzini
2016-11-17 11:51     ` Stefan Hajnoczi
2016-11-16 18:30   ` Paolo Bonzini
2016-11-16 17:47 ` [Qemu-devel] [PATCH v2 3/4] virtio: poll virtqueues for new buffers Stefan Hajnoczi
2016-11-16 17:47 ` [Qemu-devel] [PATCH v2 4/4] linux-aio: poll ring for completions Stefan Hajnoczi
2016-11-16 18:30 ` [Qemu-devel] [PATCH v2 0/4] aio: experimental virtio-blk polling mode no-reply
2016-11-17 14:15 ` Karl Rister
2016-11-18 10:54   ` Stefan Hajnoczi

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=1479318422-10979-1-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=famz@redhat.com \
    --cc=krister@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).