qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] virtio: disable notifications in blk and scsi
@ 2016-11-16 21:53 Stefan Hajnoczi
  2016-11-16 21:53 ` [Qemu-devel] [PATCH 1/3] virtio: add missing vdev->broken check Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Stefan Hajnoczi @ 2016-11-16 21:53 UTC (permalink / raw)
  To: qemu-devel
  Cc: zhunxun, Fam Zheng, Christian Borntraeger, Paolo Bonzini,
	Michael S. Tsirkin, Kevin Wolf, Stefan Hajnoczi

Disabling notifications during virtqueue processing reduces the number of
exits.  The virtio-net device already uses virtio_queue_set_notifications() but
virtio-blk and virtio-scsi do not.

The following benchmark shows a 15% reduction in virtio-blk-pci MMIO exits:

  (host)$ qemu-system-x86_64 \
              -enable-kvm -m 1024 -cpu host \
              -drive if=virtio,id=drive0,file=f24.img,format=raw,\
                     cache=none,aio=native
  (guest)$ fio # jobs=4, iodepth=8, direct=1, randread
  (host)$ sudo perf record -a -e kvm:kvm_fast_mmio

Number of kvm_fast_mmio events:
Unpatched: 685k
Patched: 592k (-15%, lower is better)

Note that a workload with iodepth=1 and a single thread will not benefit - this
is a batching optimization.  The effect should be strongest with large iodepth
and multiple threads submitting I/O.  The guest I/O scheduler also affects the
optimization.

Stefan Hajnoczi (3):
  virtio: add missing vdev->broken check
  virtio-blk: suppress virtqueue kick during processing
  virtio-scsi: suppress virtqueue kick during processing

 hw/block/virtio-blk.c | 18 ++++++++++++------
 hw/scsi/virtio-scsi.c | 36 +++++++++++++++++++++---------------
 hw/virtio/virtio.c    |  4 ++++
 3 files changed, 37 insertions(+), 21 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2017-01-05  9:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16 21:53 [Qemu-devel] [PATCH 0/3] virtio: disable notifications in blk and scsi Stefan Hajnoczi
2016-11-16 21:53 ` [Qemu-devel] [PATCH 1/3] virtio: add missing vdev->broken check Stefan Hajnoczi
2016-11-17  8:31   ` Cornelia Huck
2016-11-17 10:58     ` Stefan Hajnoczi
2016-11-17 12:24       ` Cornelia Huck
2016-11-18 10:55         ` Stefan Hajnoczi
2016-11-16 21:53 ` [Qemu-devel] [PATCH 2/3] virtio-blk: suppress virtqueue kick during processing Stefan Hajnoczi
2016-11-16 21:53 ` [Qemu-devel] [PATCH 3/3] virtio-scsi: " Stefan Hajnoczi
2016-11-16 22:17 ` [Qemu-devel] [PATCH 0/3] virtio: disable notifications in blk and scsi Michael S. Tsirkin
2016-11-17 13:27   ` Stefan Hajnoczi
2016-11-17 17:38     ` Michael S. Tsirkin
2016-11-18 10:58       ` Stefan Hajnoczi
2016-11-18 14:21         ` Michael S. Tsirkin
2016-11-18 15:20           ` Stefan Hajnoczi
2017-01-04 13:51       ` Stefan Hajnoczi
2016-11-17 11:01 ` Christian Borntraeger
2016-11-18 11:02   ` Stefan Hajnoczi
2016-11-18 11:36     ` Christian Borntraeger

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).