qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] virtio-blk: add iothread-vq-mapping parameter
@ 2023-09-18 16:16 Stefan Hajnoczi
  2023-09-18 16:16 ` [PATCH v2 1/2] qdev: add IOThreadVirtQueueMappingList property type Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Stefan Hajnoczi @ 2023-09-18 16:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Markus Armbruster, Michal Privoznik, Paolo Bonzini,
	Eduardo Habkost, qemu-block, Daniel P. Berrangé,
	Stefan Hajnoczi, Eric Blake, Kevin Wolf, Michael S. Tsirkin,
	Hanna Reitz

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: 20230912231037.826804-1-stefanha@redhat.com ("[PATCH v3 0/5] block-backend: process I/O in the current AioContext")

Stefan Hajnoczi (2):
  qdev: add IOThreadVirtQueueMappingList property type
  virtio-blk: add iothread-vq-mapping parameter

 qapi/virtio.json                    |  30 +++++
 hw/block/dataplane/virtio-blk.h     |   3 +
 include/hw/qdev-properties-system.h |   4 +
 include/hw/virtio/virtio-blk.h      |   2 +
 hw/block/dataplane/virtio-blk.c     | 163 +++++++++++++++++++++-------
 hw/block/virtio-blk.c               |  92 ++++++++++++++--
 hw/core/qdev-properties-system.c    |  47 ++++++++
 7 files changed, 287 insertions(+), 54 deletions(-)

-- 
2.41.0



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

end of thread, other threads:[~2023-12-20  7:40 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 16:16 [PATCH v2 0/2] virtio-blk: add iothread-vq-mapping parameter Stefan Hajnoczi
2023-09-18 16:16 ` [PATCH v2 1/2] qdev: add IOThreadVirtQueueMappingList property type Stefan Hajnoczi
2023-10-14  7:35   ` Markus Armbruster
2023-12-19 15:13     ` Stefan Hajnoczi
2023-12-19 16:08       ` Kevin Wolf
2023-12-20  7:39         ` Markus Armbruster
2023-12-11 13:56   ` Kevin Wolf
2023-12-11 15:32     ` Markus Armbruster
2023-12-11 21:15       ` Stefan Hajnoczi
2023-12-19  7:43         ` Markus Armbruster
2023-12-12  9:59       ` Kevin Wolf
2023-09-18 16:16 ` [PATCH v2 2/2] virtio-blk: add iothread-vq-mapping parameter Stefan Hajnoczi
2023-10-03 13:12 ` [PATCH v2 0/2] " Michael S. Tsirkin
2023-11-02 14:10 ` Kevin Wolf
2023-11-07  3:00   ` Stefan Hajnoczi
2023-11-07 10:20     ` Kevin Wolf
2023-11-07  3:29   ` 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).