From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Michal Privoznik" <mprivozn@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: [PATCH v4 0/4] virtio-blk: add iothread-vq-mapping parameter
Date: Wed, 20 Dec 2023 08:47:51 -0500 [thread overview]
Message-ID: <20231220134755.814917-1-stefanha@redhat.com> (raw)
v4:
- Use DummyVirtioForceArrays naming in QAPI schema [Markus]
v3:
- Rebased onto Kevin's block branch
- Add StringOutputVisitor "<omitted>" patch to fix "info qtree" crash
- Fix QAPI schema formatting [Markus]
- Eliminate unnecessary local variable in get_iothread_vq_mapping_list() [Markus]
virtio-blk and virtio-scsi devices need a way to specify the mapping between
IOThreads and virtqueues. At the moment all virtqueues are assigned to a single
IOThread or the main loop. This single thread can be a CPU bottleneck, so it is
necessary to allow finer-grained assignment to spread the load. With this
series applied, "pidstat -t 1" shows that guests with -smp 2 or higher are able
to exploit multiple IOThreads.
This series introduces command-line syntax for the new iothread-vq-mapping
property is as follows:
--device '{"driver":"virtio-blk-pci","iothread-vq-mapping":[{"iothread":"iothread0","vqs":[0,1,2]},...]},...'
IOThreads are specified by name and virtqueues are specified by 0-based
index.
It will be common to simply assign virtqueues round-robin across a set
of IOThreads. A convenient syntax that does not require specifying
individual virtqueue indices is available:
--device '{"driver":"virtio-blk-pci","iothread-vq-mapping":[{"iothread":"iothread0"},{"iothread":"iothread1"},...]},...'
There is no way to reassign virtqueues at runtime and I expect that to be a
very rare requirement.
Note that JSON --device syntax is required for the iothread-vq-mapping
parameter because it's non-scalar.
Based-on: 81e69329d6a4018f4b37d15b6fc845fbe585a93b (https://repo.or.cz/qemu/kevin.git block)
Stefan Hajnoczi (4):
qdev-properties: alias all object class properties
string-output-visitor: show structs as "<omitted>"
qdev: add IOThreadVirtQueueMappingList property type
virtio-blk: add iothread-vq-mapping parameter
qapi/virtio.json | 29 +++++
hw/block/dataplane/virtio-blk.h | 3 +
include/hw/qdev-properties-system.h | 5 +
include/hw/virtio/virtio-blk.h | 2 +
include/qapi/string-output-visitor.h | 6 +-
hw/block/dataplane/virtio-blk.c | 155 ++++++++++++++++++++-------
hw/block/virtio-blk.c | 92 +++++++++++++---
hw/core/qdev-properties-system.c | 46 ++++++++
hw/core/qdev-properties.c | 18 ++--
qapi/string-output-visitor.c | 16 +++
10 files changed, 311 insertions(+), 61 deletions(-)
--
2.43.0
next reply other threads:[~2023-12-20 13:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-20 13:47 Stefan Hajnoczi [this message]
2023-12-20 13:47 ` [PATCH v4 1/4] qdev-properties: alias all object class properties Stefan Hajnoczi
2023-12-21 12:39 ` Kevin Wolf
2023-12-21 15:47 ` Stefan Hajnoczi
2023-12-20 13:47 ` [PATCH v4 2/4] string-output-visitor: show structs as "<omitted>" Stefan Hajnoczi
2023-12-20 13:47 ` [PATCH v4 3/4] qdev: add IOThreadVirtQueueMappingList property type Stefan Hajnoczi
2023-12-20 13:47 ` [PATCH v4 4/4] virtio-blk: add iothread-vq-mapping parameter Stefan Hajnoczi
2023-12-21 13:10 ` Kevin Wolf
2024-01-18 21:28 ` Stefan Hajnoczi
2023-12-21 13:40 ` Kevin Wolf
2024-01-19 13:41 ` Stefan Hajnoczi
2023-12-21 21:07 ` [PATCH v4 0/4] " Kevin Wolf
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=20231220134755.814917-1-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=michael.roth@amd.com \
--cc=mprivozn@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).