qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] virtio: enable blk and scsi multi-queue by default
@ 2020-01-16 10:58 Stefan Hajnoczi
  2020-01-16 10:58 ` [PATCH 1/5] virtio-scsi: introduce a constant for fixed virtqueues Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Stefan Hajnoczi @ 2020-01-16 10:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fam Zheng, Kevin Wolf, Eduardo Habkost, qemu-block,
	Michael S. Tsirkin, Stefan Hajnoczi, Max Reitz, Paolo Bonzini

Enabling multi-queue helps performance on SMP guests because the completion
interrupt is handled on the vCPU that submitted the I/O request.  This avoids
IPIs inside the guest.

Note that performance is unchanged in these cases:
1. Uniprocessor guests.  They don't have IPIs.
2. Application threads might be scheduled on the sole vCPU that handles
   completion interrupts purely by chance.  (This is one reason why benchmark
   results can vary noticably between runs.)
3. Users may bind the application to the vCPU that handles completion
   interrupts.

Set the number of queues to the number of vCPUs by default.  Older machine
types continue to default to 1 queue for live migration compatibility.

This patch improves IOPS by 1-4% on an Intel Optane SSD with 4 vCPUs, -drive
aio=native, and fio bs=4k direct=1 rw=randread.

Stefan Hajnoczi (5):
  virtio-scsi: introduce a constant for fixed virtqueues
  virtio: add VirtioDeviceClass->get_num_virtqueues()
  virtio-scsi: default num_queues to -smp N
  virtio-blk: default num_queues to -smp N
  vhost-user-blk: default num_queues to -smp N

 hw/block/vhost-user-blk.c          | 15 +++++++++++++++
 hw/block/virtio-blk.c              | 17 +++++++++++++++++
 hw/core/machine.c                  |  5 +++++
 hw/scsi/vhost-scsi.c               |  2 ++
 hw/scsi/vhost-user-scsi.c          |  4 +++-
 hw/scsi/virtio-scsi.c              | 25 ++++++++++++++++++++++---
 hw/virtio/vhost-scsi-pci.c         |  4 ++--
 hw/virtio/vhost-user-blk-pci.c     |  3 ++-
 hw/virtio/vhost-user-scsi-pci.c    |  4 ++--
 hw/virtio/virtio-blk-pci.c         |  3 ++-
 hw/virtio/virtio-scsi-pci.c        |  4 ++--
 include/hw/virtio/vhost-user-blk.h |  1 +
 include/hw/virtio/virtio-blk.h     |  1 +
 include/hw/virtio/virtio-scsi.h    |  4 ++++
 include/hw/virtio/virtio.h         |  7 +++++++
 15 files changed, 87 insertions(+), 12 deletions(-)

-- 
2.24.1



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

end of thread, other threads:[~2020-01-16 15:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-16 10:58 [PATCH 0/5] virtio: enable blk and scsi multi-queue by default Stefan Hajnoczi
2020-01-16 10:58 ` [PATCH 1/5] virtio-scsi: introduce a constant for fixed virtqueues Stefan Hajnoczi
2020-01-16 10:58 ` [PATCH 2/5] virtio: add VirtioDeviceClass->get_num_virtqueues() Stefan Hajnoczi
2020-01-16 10:58 ` [PATCH 3/5] virtio-scsi: default num_queues to -smp N Stefan Hajnoczi
2020-01-16 11:53   ` Cornelia Huck
2020-01-16 14:16     ` Stefan Hajnoczi
2020-01-16 15:02       ` Cornelia Huck
2020-01-16 10:58 ` [PATCH 4/5] virtio-blk: " Stefan Hajnoczi
2020-01-16 10:58 ` [PATCH 5/5] vhost-user-blk: " Stefan Hajnoczi

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