From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Max Reitz <mreitz@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH 0/5] virtio: enable blk and scsi multi-queue by default
Date: Thu, 16 Jan 2020 10:58:37 +0000 [thread overview]
Message-ID: <20200116105842.271179-1-stefanha@redhat.com> (raw)
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
next reply other threads:[~2020-01-16 11:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 10:58 Stefan Hajnoczi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200116105842.271179-1-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=ehabkost@redhat.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).