vdpa-net: improve migration downtime through descriptor ASID and persistent IOTLB
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest40 patches 61 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/40 | linux-headers: add vhost_types.h and vhost.hinclude/ linux-headers/ | +22 | 2 replies | |
| 2/40 | vdpa: add vhost_vdpa_get_vring_desc_groupnet/ | +19 | 1 reply | |
| 3/40 | vdpa: probe descriptor group index for data vqsnet/ | +89 | 2 replies | |
| 4/40 | vdpa: piggyback desc_group index when probing isolated cvqnet/ | +17 | 1 reply | |
| 5/40 | vdpa: populate desc_group from net_vhost_vdpa_initinclude/ net/ | +14 | 3 replies | |
| 6/40 | vhost: make svq work with gpa without iova translationhw/ | +23 | 2 replies | |
| 7/40 | vdpa: move around vhost_vdpa_set_address_space_idnet/ | +18 | 2 replies | |
| 8/40 | vdpa: add back vhost_vdpa_net_first_nc_vdpanet/ | +13 | 2 replies | |
| 9/40 | vdpa: no repeat setting shadow_datanet/ | +1 | 2 replies | |
| 10/40 | vdpa: assign svq descriptors a separate ASID when possiblehw/ net/ | +57 | 2 replies | |
| 11/40 | vdpa: factor out vhost_vdpa_last_devhw/ | +7 | 2 replies | |
| 12/40 | vdpa: check map_thread_enabled before join maps threadhw/ | +1 | 0 replies | |
| 13/40 | vdpa: ref counting VhostVDPASharedinclude/ net/ | +12 | 1 reply | |
| 14/40 | vdpa: convert iova_tree to ref count basednet/ | +2 | 2 replies | |
| 15/40 | vdpa: add svq_switching and flush_map to headerinclude/ | +6 | 1 reply | |
| 16/40 | vdpa: indicate SVQ switching via flagnet/ | +2 | 1 reply | |
| 17/40 | vdpa: judge if map can be kept across resetnet/ | +40 | 2 replies | |
| 18/40 | vdpa: unregister listener on last dev cleanuphw/ | +4 | 2 replies | |
| 19/40 | vdpa: should avoid map flushing with persistent iotlbhw/ hw/ | +21 | 1 reply | |
| 20/40 | vdpa: avoid mapping flush across resethw/ | +2 | 1 reply | |
| 21/40 | vdpa: vhost_vdpa_dma_batch_end_once renamehw/ | +3 | 2 replies | |
| 22/40 | vdpa: factor out vhost_vdpa_map_batch_beginhw/ hw/ | +17 | 1 reply | |
| 23/40 | vdpa: vhost_vdpa_dma_batch_begin_once renamehw/ | +4 | 1 reply | |
| 24/40 | vdpa: factor out vhost_vdpa_dma_batch_endhw/ hw/ | +19 | 1 reply | |
| 25/40 | vdpa: add asid to dma_batch_once APIhw/ hw/ | +10 | 2 replies | |
| 26/40 | vdpa: return int for dma_batch_once APIhw/ | +9 | 0 replies | |
| 27/40 | vdpa: add asid to all dma_batch call siteshw/ | +9 | 0 replies | |
| 28/40 | vdpa: support iotlb_batch_asidhw/ include/ net/ | +21 | 2 replies | |
| 29/40 | vdpa: expose API vhost_vdpa_dma_batch_oncehw/ include/ | +18 | 2 replies | |
| 30/40 | vdpa: batch map/unmap op per svq pair basishw/ | +5 | 1 reply | |
| 31/40 | vdpa: batch map and unmap around cvq svq start/stopnet/ | +7 | 1 reply | |
| 32/40 | vdpa: factor out vhost_vdpa_net_get_nc_vdpanet/ | +9 | 1 reply | |
| 33/40 | vdpa: batch multiple dma_unmap to a single call for vm stophw/ include/ net/ | +80 | 2 replies | |
| 34/40 | vdpa: fix network breakage after cancelling migrationhw/ | +6 | 1 reply | |
| 35/40 | vdpa: add vhost_vdpa_set_address_space_id tracenet/ net/ | +6 | 2 replies | |
| 36/40 | vdpa: add vhost_vdpa_get_vring_base trace for svq modehw/ hw/ | +3 | 2 replies | |
| 37/40 | vdpa: add vhost_vdpa_set_dev_vring_base trace for svq modehw/ hw/ | +5 | 2 replies | |
| 38/40 | vdpa: add trace events for eval_flushnet/ net/ | +9 | 1 reply | |
| 39/40 | vdpa: add trace events for vhost_vdpa_net_load_cmdnet/ net/ | +4 | 1 reply | |
| 40/40 | vdpa: add trace event for vhost_vdpa_net_load_mqnet/ net/ | +3 | 2 replies |
Reviews trailers per patch
16 of 40 patches have a Reviewed-by or Acked-by.
| Patch | Eugenio Pérez | Jason Wang |
|---|---|---|
| 1/40 | ||
| 2/40 | A-b | |
| 3/40 | ||
| 4/40 | ||
| 5/40 | ||
| 6/40 | R-b | |
| 7/40 | R-b | A-b |
| 8/40 | R-b | |
| 9/40 | R-b | A-b |
| 10/40 | ||
| 11/40 | R-b | A-b |
| 12/40 | ||
| 13/40 | ||
| 14/40 | ||
| 15/40 | ||
| 16/40 | ||
| 17/40 | ||
| 18/40 | ||
| 19/40 | ||
| 20/40 | ||
| 21/40 | ||
| 22/40 | A-b | |
| 23/40 | ||
| 24/40 | ||
| 25/40 | ||
| 26/40 | ||
| 27/40 | ||
| 28/40 | ||
| 29/40 | ||
| 30/40 | A-b | |
| 31/40 | A-b | |
| 32/40 | A-b | |
| 33/40 | ||
| 34/40 | A-b | |
| 35/40 | R-b | |
| 36/40 | R-b | A-b |
| 37/40 | R-b | A-b |
| 38/40 | ||
| 39/40 | R-b | |
| 40/40 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/40] vdpa-net: improve migration downtime through descriptor ASID and persistent IOTLB
This patch series contain several enhancements to SVQ live migration downtime for vDPA-net hardware device, specifically on mlx5_vdpa. Currently it is based off of Eugenio's RFC v2 .load_setup series [1] to utilize the shared facility and reduce frictions in merging or duplicating code if at all possible.
It's stacked up in particular order as below, as the optimization for one on the top has to depend on others on the bottom. Here's a breakdown for what each part does respectively:
Patch # | Feature / optimization
---------V-------------------------------------------------------------------
35 - 40 | trace events 34 | migrate_cancel bug fix 21 - 33 | (Un)map batching at stop-n-copy to further optimize LM down time 11 - 20 | persistent IOTLB [3] to improve LM down time 02 - 10 | SVQ descriptor ASID [2] to optimize SVQ switching 01 | dependent linux headers
V
Let's first define 2 sources of downtime that this work is concerned with:
* SVQ switching downtime (Downtime #1): downtime at the start of migration. Time spent on teardown and setup for SVQ mode switching, and this downtime is regarded as the maxium time for an individual vdpa-net device. No memory transfer is involved during SVQ switching, hence no .
* LM downtime (Downtime #2): aggregated downtime for all vdpa-net devices on resource teardown and setup in the last stop-n-copy phase on source host.
With each part of the optimizations applied bottom up, the effective outcome in terms of down time (in seconds) performance can be observed in this table:
| Downtime #1 | Downtime #2
--------------------+-------------------+-------------------
Baseline QEMU | 20s ~ 30s | 20s
| |
Iterative map | |
at destination[1] | 5s | 20s
| |
SVQ descriptor | |
ASID [2] | 2s | 5s
| |
| |
persistent IOTLB | 2s | 2s
[3] | |
| |
(Un)map batching | |
at stop-n-copy | 1.7s | 1.5s
before switchover | |(VM config: 128GB mem, 2 mlx5_vdpa devices, each w/ 4 data vqs)
Please find the details regarding each enhancement on the commit log.
Thanks,
-Siwei
[1] [RFC PATCH v2 00/10] Map memory at destination .load_setup in vDPA-net migration
https://lists.nongnu.org/archive/html/qemu-devel/2023-11/msg05711.html
[2] VHOST_BACKEND_F_DESC_ASID
https://lore.kernel.org/virtualization/[email protected]/
[3] VHOST_BACKEND_F_IOTLB_PERSIST
https://lore.kernel.org/virtualization/[email protected]/
---
Si-Wei Liu (40):
linux-headers: add vhost_types.h and vhost.h
vdpa: add vhost_vdpa_get_vring_desc_group
vdpa: probe descriptor group index for data vqs
vdpa: piggyback desc_group index when probing isolated cvq
vdpa: populate desc_group from net_vhost_vdpa_init
vhost: make svq work with gpa without iova translation
vdpa: move around vhost_vdpa_set_address_space_id
vdpa: add back vhost_vdpa_net_first_nc_vdpa
vdpa: no repeat setting shadow_data
vdpa: assign svq descriptors a separate ASID when possible
vdpa: factor out vhost_vdpa_last_dev
vdpa: check map_thread_enabled before join maps thread
vdpa: ref counting VhostVDPAShared
vdpa: convert iova_tree to ref count based
vdpa: add svq_switching and flush_map to header
vdpa: indicate SVQ switching via flag
vdpa: judge if map can be kept across reset
vdpa: unregister listener on last dev cleanup
vdpa: should avoid map flushing with persistent iotlb
vdpa: avoid mapping flush across reset
vdpa: vhost_vdpa_dma_batch_end_once rename
vdpa: factor out vhost_vdpa_map_batch_begin
vdpa: vhost_vdpa_dma_batch_begin_once rename
vdpa: factor out vhost_vdpa_dma_batch_end
vdpa: add asid to dma_batch_once API
vdpa: return int for dma_batch_once API
vdpa: add asid to all dma_batch call sites
vdpa: support iotlb_batch_asid
vdpa: expose API vhost_vdpa_dma_batch_once
vdpa: batch map/unmap op per svq pair basis
vdpa: batch map and unmap around cvq svq start/stop
vdpa: factor out vhost_vdpa_net_get_nc_vdpa
vdpa: batch multiple dma_unmap to a single call for vm stop
vdpa: fix network breakage after cancelling migration
vdpa: add vhost_vdpa_set_address_space_id trace
vdpa: add vhost_vdpa_get_vring_base trace for svq mode
vdpa: add vhost_vdpa_set_dev_vring_base trace for svq mode
vdpa: add trace events for eval_flush
vdpa: add trace events for vhost_vdpa_net_load_cmd
vdpa: add trace event for vhost_vdpa_net_load_mq
hw/virtio/trace-events | 9 +- hw/virtio/vhost-shadow-virtqueue.c | 35 ++- hw/virtio/vhost-vdpa.c | 156 +++++++--- include/hw/virtio/vhost-vdpa.h | 16 + include/standard-headers/linux/vhost_types.h | 13 + linux-headers/linux/vhost.h | 9 + net/trace-events | 8 + net/vhost-vdpa.c | 434 ++++++++++++++++++++++----- 8 files changed, 558 insertions(+), 122 deletions(-)
Signature · 1 line
1.8.3.1