diff options
author | Eugenio Pérez <eperezma@redhat.com> | 2025-05-22 10:58:39 -0400 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2025-06-02 14:29:15 -0400 |
commit | 494c50dcc0995ae6eb526d2848c33cbf910ab218 (patch) | |
tree | 5db8e7ab591d5601f044576a9676afd71238ecc9 /scripts/qemugdb/timers.py | |
parent | a400720365ea86602044b78dd8654911d0fe3977 (diff) | |
download | qemu-494c50dcc0995ae6eb526d2848c33cbf910ab218.zip qemu-494c50dcc0995ae6eb526d2848c33cbf910ab218.tar.gz qemu-494c50dcc0995ae6eb526d2848c33cbf910ab218.tar.bz2 |
vdpa: move memory listener register to vhost_vdpa_init
Current memory operations like pinning may take a lot of time at the
destination. Currently they are done after the source of the migration is
stopped, and before the workload is resumed at the destination. This is a
period where neigher traffic can flow, nor the VM workload can continue
(downtime).
We can do better as we know the memory layout of the guest RAM at the
destination from the moment that all devices are initializaed. So
moving that operation allows QEMU to communicate the kernel the maps
while the workload is still running in the source, so Linux can start
mapping them.
As a small drawback, there is a time in the initialization where QEMU
cannot respond to QMP etc. By some testing, this time is about
0.2seconds. This may be further reduced (or increased) depending on the
vdpa driver and the platform hardware, and it is dominated by the cost
of memory pinning.
This matches the time that we move out of the called downtime window.
The downtime is measured as the elapsed trace time between the last
vhost_vdpa_suspend on the source and the last vhost_vdpa_set_vring_enable_one
on the destination. In other words, from "guest CPUs freeze" to the
instant the final Rx/Tx queue-pair is able to start moving data.
Using ConnectX-6 Dx (MLX5) NICs in vhost-vDPA mode with 8 queue-pairs,
the series reduces guest-visible downtime during back-to-back live
migrations by more than half:
- 39G VM: 4.72s -> 2.09s (-2.63s, ~56% improvement)
- 128G VM: 14.72s -> 5.83s (-8.89s, ~60% improvement)
Tested-by: Lei Yang <leiyang@redhat.com>
Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Jonah Palmer <jonah.palmer@oracle.com>
Message-Id: <20250522145839.59974-8-jonah.palmer@oracle.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'scripts/qemugdb/timers.py')
0 files changed, 0 insertions, 0 deletions