block: Set an option to pin virtio block threads to host cpus

Currently the only way to set the affinity for virtio block threads is
to boot the VM, search for the tid of each of the virtio block threads,
then set the affinity manually. This commit adds an option to pin virtio
block queues to specific host cpus (similar to pinning vcpus to host
cpus). A queue_affinity option has been added to the disk flag in
the cli to specify a mapping of queue indices to host cpus.

Signed-off-by: acarp <acarp@crusoeenergy.com>
This commit is contained in:
acarp
2024-01-24 16:37:47 -08:00
committed by Rob Bradford
parent ee0cf3a715
commit 035c4b20fb
8 changed files with 181 additions and 4 deletions

View File

@@ -828,6 +828,19 @@ components:
type: string
rate_limiter_config:
$ref: "#/components/schemas/RateLimiterConfig"
VirtQueueAffinity:
required:
- queue_index
- host_cpus
type: object
properties:
queue_index:
type: integer
host_cpus:
type: array
items:
type: integer
DiskConfig:
required:
@@ -867,6 +880,10 @@ components:
type: string
rate_limit_group:
type: string
affinity:
type: array
items:
$ref: "#/components/schemas/VirtQueueAffinity"
NetConfig:
type: object