Rate This Document
Findability
Accuracy
Completeness
Readability

IPI Latency Optimization for High-Specification VMs

In high-specification AArch64 KVM VMs, the delivery latency of inter-processor interrupts (IPIs) is significantly higher than in physical machines. This has become a key bottleneck affecting the multi-core communication performance of VMs. This issue is caused by the inefficiency of the software-generated interrupt (SGI) distribution path on the kernel side.

On the kernel side, when the guest OS sends an SGI to the target vCPU by writing the ICC_SGI1R_EL1 register, KVM needs to calculate the target Multiprocessor Affinity Register (MPIDR) based on the affinity information and then traverse all vCPUs for matching. The time complexity is O(n). IPI delivery latency per operation increases with the number of vCPUs. This feature pre-calculates a compressed mapping table from MPIDR values to vCPU indexes when a VM runs for the first time. In this way, the SGI distribution path traversal (time complexity: O(n)) is optimized to direct search (time complexity: O(1)), eliminating the performance bottleneck on the delivery path.

Constraints

  • Hardware environment: Only new Kunpeng 920 processor models and Kunpeng 950 processors are supported.
  • Software environment: The host OS is openEuler 24.03 LTS SP3, the kernel baseline is OLK-6.6 (6.6.0-135.0.0), the QEMU version is 8.2.0, and the libvirt version is 9.10.0. In addition, the SGI optimization and cacheinfo patches must be applied for QEMU/libvirt.

Application Scenarios

This feature applies to high-specification KVM VMs, especially when the VMs run workloads that are sensitive to inter-core communication latency, such as large-scale databases (MySQL and PostgreSQL), distributed computing frameworks, and high-performance computing tasks. In these scenarios, synchronization operations (such as RCU callbacks) between processes or threads frequently trigger IPIs. The IPI delivery latency directly affects the overall throughput and response time of applications. By optimizing the SGI distribution path to O(1), the IPI delivery latency can be significantly reduced for high-specification VMs, improving service performance in multi-core concurrency scenarios.