mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-18 05:28:36 -07:00
Allow the number of queues to be configured using --export vhost-user-blk,num-queues=N. This setting should match the QEMU --device vhost-user-blk-pci,num-queues=N setting but QEMU vhost-user-blk.c lowers its own value if the vhost-user-blk backend offers fewer queues than QEMU. The vhost-user-blk-server.c code is already capable of multi-queue. All virtqueue processing runs in the same AioContext. No new locking is needed. Add the num-queues=N option and set the VIRTIO_BLK_F_MQ feature bit. Note that the feature bit only announces the presence of the num_queues configuration space field. It does not promise that there is more than 1 virtqueue, so we can set it unconditionally. I tested multi-queue by running a random read fio test with numjobs=4 on an -smp 4 guest. After the benchmark finished the guest /proc/interrupts file showed activity on all 4 virtio-blk MSI-X. The /sys/block/vda/mq/ directory shows that Linux blk-mq has 4 queues configured. An automated test is included in the next commit. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Message-id: 20201001144604.559733-2-stefanha@redhat.com [Fixed accidental tab characters as suggested by Markus Armbruster --Stefan] Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
||
|---|---|---|
| .. | ||
| acpi.json | ||
| audio.json | ||
| authz.json | ||
| block-core.json | ||
| block-export.json | ||
| block.json | ||
| char.json | ||
| common.json | ||
| control.json | ||
| crypto.json | ||
| dump.json | ||
| error.json | ||
| introspect.json | ||
| job.json | ||
| machine-target.json | ||
| machine.json | ||
| meson.build | ||
| migration.json | ||
| misc-target.json | ||
| misc.json | ||
| net.json | ||
| opts-visitor.c | ||
| pci.json | ||
| pragma.json | ||
| qapi-clone-visitor.c | ||
| qapi-dealloc-visitor.c | ||
| qapi-schema.json | ||
| qapi-util.c | ||
| qapi-visit-core.c | ||
| qdev.json | ||
| qmp-dispatch.c | ||
| qmp-event.c | ||
| qmp-registry.c | ||
| qobject-input-visitor.c | ||
| qobject-output-visitor.c | ||
| qom.json | ||
| rdma.json | ||
| replay.json | ||
| rocker.json | ||
| run-state.json | ||
| sockets.json | ||
| string-input-visitor.c | ||
| string-output-visitor.c | ||
| tpm.json | ||
| trace-events | ||
| trace.h | ||
| trace.json | ||
| transaction.json | ||
| ui.json | ||