All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3 00/10] aio: experimental virtio-blk polling mode
@ 2016-11-22 16:31 Stefan Hajnoczi
  2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 01/10] virtio: add missing vdev->broken check Stefan Hajnoczi
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Stefan Hajnoczi @ 2016-11-22 16:31 UTC (permalink / raw)
  To: qemu-devel
  Cc: borntraeger, Paolo Bonzini, Karl Rister, Fam Zheng, Stefan Hajnoczi

v3:
 * Avoid ppoll(2)/epoll_wait(2) if polling succeeded [Paolo]
 * Disable guest->host virtqueue notification during polling [Christian]
 * Rebased on top of my virtio-blk/scsi virtqueue notification disable patches

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 (10):
  virtio: add missing vdev->broken check
  virtio-blk: suppress virtqueue kick during processing
  virtio-scsi: suppress virtqueue kick during processing
  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
  virtio: turn vq->notification into a nested counter
  aio: add .io_poll_begin/end() callbacks
  virtio: disable virtqueue notifications during polling

 aio-posix.c                 | 197 +++++++++++++++++++++++++++++++++++++++++++-
 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/block/virtio-blk.c       |  18 ++--
 hw/scsi/virtio-scsi.c       |  36 ++++----
 hw/virtio/virtio.c          |  60 ++++++++++++--
 include/block/aio.h         |  28 ++++++-
 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 +-
 20 files changed, 378 insertions(+), 76 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-11-23 10:59 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-22 16:31 [Qemu-devel] [PATCH v3 00/10] aio: experimental virtio-blk polling mode Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 01/10] virtio: add missing vdev->broken check Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 02/10] virtio-blk: suppress virtqueue kick during processing Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 03/10] virtio-scsi: " Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 04/10] aio: add AioPollFn and io_poll() interface Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 05/10] aio: add polling mode to AioContext Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 06/10] virtio: poll virtqueues for new buffers Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 07/10] linux-aio: poll ring for completions Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 08/10] virtio: turn vq->notification into a nested counter Stefan Hajnoczi
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 09/10] aio: add .io_poll_begin/end() callbacks Stefan Hajnoczi
2016-11-22 17:21   ` Paolo Bonzini
2016-11-23  9:44     ` Stefan Hajnoczi
2016-11-23 10:59       ` Paolo Bonzini
2016-11-22 16:31 ` [Qemu-devel] [PATCH v3 10/10] virtio: disable virtqueue notifications during polling Stefan Hajnoczi
2016-11-22 16:57 ` [Qemu-devel] [PATCH v3 00/10] aio: experimental virtio-blk polling mode no-reply
2016-11-22 17:13 ` Paolo Bonzini
2016-11-22 19:21 ` Christian Borntraeger
2016-11-23  9:51   ` Stefan Hajnoczi

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.