All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] virtio-pci: enable blk and scsi multi-queue by default
@ 2020-05-27 10:29 Stefan Hajnoczi
  2020-05-27 10:29 ` [PATCH v4 1/5] virtio-pci: add virtio_pci_optimal_num_queues() helper Stefan Hajnoczi
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Stefan Hajnoczi @ 2020-05-27 10:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Pankaj Gupta, Eduardo Habkost, qemu-block,
	Michael S. Tsirkin, cohuck, Max Reitz, Stefan Hajnoczi,
	Paolo Bonzini, Fam Zheng, Raphael Norwitz

v3:
 * Introduce virtio_pci_optimal_num_queues() helper to enforce VIRTIO_QUEUE_MAX
   in one place
 * Use VIRTIO_SCSI_VQ_NUM_FIXED constant in all cases [Cornelia]
 * Update hw/core/machine.c compat properties for QEMU 5.0 [Michael]
v3:
 * Add new performance results that demonstrate the scalability
 * Mention that this is PCI-specific [Cornelia]
v2:
 * Let the virtio-DEVICE-pci device select num-queues because the optimal
   multi-queue configuration may differ between virtio-pci, virtio-mmio, and
   virtio-ccw [Cornelia]

Enabling multi-queue on virtio-pci storage devices improves 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 on virtio-blk and
virtio-scsi PCI devices.  Older machine types continue to default to 1 queue
for live migration compatibility.

Random read performance:
      IOPS
q=1    78k
q=32  104k  +33%

Boot time:
      Duration
q=1        51s
q=32     1m41s  +98%

Guest configuration: 32 vCPUs, 101 virtio-blk-pci disks

Previously measured results on a 4 vCPU guest were also positive but showed a
smaller 1-4% performance improvement.  They are no longer valid because
significant event loop optimizations have been merged.

Stefan Hajnoczi (5):
  virtio-pci: add virtio_pci_optimal_num_queues() helper
  virtio-scsi: introduce a constant for fixed 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/virtio/virtio-pci.h             |  9 +++++++++
 include/hw/virtio/vhost-user-blk.h |  2 ++
 include/hw/virtio/virtio-blk.h     |  2 ++
 include/hw/virtio/virtio-scsi.h    |  5 +++++
 hw/block/vhost-user-blk.c          |  6 +++++-
 hw/block/virtio-blk.c              |  6 +++++-
 hw/core/machine.c                  |  8 +++++++-
 hw/scsi/vhost-scsi.c               |  3 ++-
 hw/scsi/vhost-user-scsi.c          |  5 +++--
 hw/scsi/virtio-scsi.c              | 13 +++++++++----
 hw/virtio/vhost-scsi-pci.c         |  9 +++++++--
 hw/virtio/vhost-user-blk-pci.c     |  4 ++++
 hw/virtio/vhost-user-scsi-pci.c    |  9 +++++++--
 hw/virtio/virtio-blk-pci.c         |  7 ++++++-
 hw/virtio/virtio-pci.c             |  7 +++++++
 hw/virtio/virtio-scsi-pci.c        |  9 +++++++--
 16 files changed, 87 insertions(+), 17 deletions(-)

-- 
2.25.4


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

end of thread, other threads:[~2020-07-06 14:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 10:29 [PATCH v4 0/5] virtio-pci: enable blk and scsi multi-queue by default Stefan Hajnoczi
2020-05-27 10:29 ` [PATCH v4 1/5] virtio-pci: add virtio_pci_optimal_num_queues() helper Stefan Hajnoczi
2020-05-28 15:35   ` Cornelia Huck
2020-06-09 15:37     ` Michael S. Tsirkin
2020-07-06 13:25     ` Stefan Hajnoczi
2020-07-06 14:14       ` Cornelia Huck
2020-05-27 10:29 ` [PATCH v4 2/5] virtio-scsi: introduce a constant for fixed virtqueues Stefan Hajnoczi
2020-05-28 14:18   ` Pankaj Gupta
2020-05-28 15:22   ` Philippe Mathieu-Daudé
2020-05-31  2:43   ` Raphael Norwitz
2020-05-27 10:29 ` [PATCH v4 3/5] virtio-scsi: default num_queues to -smp N Stefan Hajnoczi
2020-05-27 10:38   ` Daniel P. Berrangé
2020-05-28  8:50     ` Stefan Hajnoczi
2020-05-27 10:29 ` [PATCH v4 4/5] virtio-blk: " Stefan Hajnoczi
2020-05-28 14:45   ` Pankaj Gupta
2020-05-27 10:29 ` [PATCH v4 5/5] vhost-user-blk: " Stefan Hajnoczi
2020-05-31  2:42   ` Raphael Norwitz
2020-06-09 15:36     ` Michael S. Tsirkin

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.