]> www.infradead.org Git - users/dwmw2/qemu.git/commit
kvm: reuse per-vcpu stats fd to avoid vcpu interruption
authorMarcelo Tosatti <mtosatti@redhat.com>
Sun, 18 Jun 2023 21:24:40 +0000 (23:24 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Jun 2023 08:23:01 +0000 (10:23 +0200)
commit3b6f485275ae95a81eec589d2773b86ca9ddec4d
tree1af7fa4f2f23bd605d516c5bb05b0d937b6fd559
parent3d9981cde964ea80f9c58072ddbb4df8b5a7183a
kvm: reuse per-vcpu stats fd to avoid vcpu interruption

A regression has been detected in latency testing of KVM guests.
More specifically, it was observed that the cyclictest
numbers inside of an isolated vcpu (running on isolated pcpu) are:

Where a maximum of 50us is acceptable.

The implementation of KVM_GET_STATS_FD uses run_on_cpu to query
per vcpu statistics, which interrupts the vcpu (and is unnecessary).

To fix this, open the per vcpu stats fd on vcpu initialization,
and read from that fd from QEMU's main thread.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/kvm/kvm-all.c
include/hw/core/cpu.h