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

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.  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 (4):
  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/block/vhost-user-blk.c          |  6 +++++-
 hw/block/virtio-blk.c              |  6 +++++-
 hw/core/machine.c                  |  5 +++++
 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         | 10 ++++++++--
 hw/virtio/vhost-user-blk-pci.c     |  6 ++++++
 hw/virtio/vhost-user-scsi-pci.c    | 10 ++++++++--
 hw/virtio/virtio-blk-pci.c         |  9 ++++++++-
 hw/virtio/virtio-scsi-pci.c        | 10 ++++++++--
 include/hw/virtio/vhost-user-blk.h |  2 ++
 include/hw/virtio/virtio-blk.h     |  2 ++
 include/hw/virtio/virtio-scsi.h    |  5 +++++
 14 files changed, 76 insertions(+), 16 deletions(-)

-- 
2.24.1



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

end of thread, other threads:[~2020-02-21 10:55 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24 10:01 [PATCH v2 0/4] virtio-pci: enable blk and scsi multi-queue by default Stefan Hajnoczi
2020-01-24 10:01 ` [PATCH v2 1/4] virtio-scsi: introduce a constant for fixed virtqueues Stefan Hajnoczi
2020-01-27 12:59   ` Cornelia Huck
2020-01-24 10:01 ` [PATCH v2 2/4] virtio-scsi: default num_queues to -smp N Stefan Hajnoczi
2020-01-27 13:10   ` Cornelia Huck
2020-01-29 15:44     ` Stefan Hajnoczi
2020-01-30  0:29       ` Paolo Bonzini
2020-01-30 10:52         ` Stefan Hajnoczi
2020-01-30 11:03           ` Cornelia Huck
2020-02-03 10:25           ` Sergio Lopez
2020-02-03 10:35             ` Michael S. Tsirkin
2020-02-03 10:51             ` Cornelia Huck
2020-02-03 10:57             ` Daniel P. Berrangé
2020-02-03 11:39               ` Sergio Lopez
2020-02-03 12:53                 ` Michael S. Tsirkin
2020-02-11 16:20                 ` Stefan Hajnoczi
2020-02-11 16:31                   ` Michael S. Tsirkin
2020-02-12 11:18                     ` Stefan Hajnoczi
2020-02-21 10:55                       ` Stefan Hajnoczi
2020-01-24 10:01 ` [PATCH v2 3/4] virtio-blk: " Stefan Hajnoczi
2020-01-27 13:14   ` Cornelia Huck
2020-01-24 10:01 ` [PATCH v2 4/4] vhost-user-blk: " Stefan Hajnoczi
2020-01-27 13:17   ` Cornelia Huck
2020-01-27  9:59 ` [PATCH v2 0/4] virtio-pci: enable blk and scsi multi-queue by default Stefano Garzarella

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.