Skip to content

Batch register access for live migration optimization

Yize Wang kvmarm linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: arm64: Add batch group constant and data structure to UAPI headerarch/arm64/include/uapi/asm/kvm.h+10 -00 replies
2/2KVM: arm64: Add VGIC v3 batch register access implementationarch/arm64/kvm/vgic/vgic-kvm-device.c+104 -90 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Batch register access for live migration optimization

This series adds batch register access support to KVM/arm64 to reduce syscall overhead during VM live migration.

Currently, QEMU issues one ioctl per register when saving/restoring VGIC state. On large VM configurations this means tens of thousands of syscalls, where lock acquisition and context switch overhead dominates migration downtime. Thus, we provide a batch register method to allow userspace read/write multiple distributor and redistributor registers in a single call. In this way, we can significantly reduce syscalls and migration downtime.

Test the VM migration time under pressure conditions. The VM specifications for migration are as follows:
- VM use 4-K page;
- the number of VCPU is 160;
- the total memory is 320Gigabit;
- use 'Redis SET-benchmark' to pressurize VM;

Performance results (3-run average, ms):

    | Metric              | Without patch | With patch | Improvement |
    |---------------------|---------------|------------|-------------|
    | Migration downtime  |        536    |     321    |     40%     |
    | Source (total)      |        344    |     230    |     33%     |
    |   - VGIC put        |        158    |      40    |     75%     |
    |   - VGIC get        |        120    |      19    |     84%     |
    | Destination (total) |        192    |      91    |     53%     |
    |   - VGIC put        |        132    |      27    |     80%     |

Yize Wang (2):
KVM: arm64: Add batch group constant and data structure to UAPI header
KVM: arm64: Add VGIC v3 batch register access implementation

 arch/arm64/include/uapi/asm/kvm.h     |  10 +++
 arch/arm64/kvm/vgic/vgic-kvm-device.c | 113 +++++++++++++++++++++++++++++++---
 2 files changed, 114 insertions(+), 9 deletions(-)