Marcelo Tosatti <mtosa...@redhat.com> writes: > 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: > > # Max Latencies: 00090 00096 00141 > > 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 <mtosa...@redhat.com>
[...] > @@ -4038,7 +4040,8 @@ static StatsDescriptors > *find_stats_descriptors(StatsTarget target, int stats_fd > } > > static void query_stats(StatsResultList **result, StatsTarget target, > - strList *names, int stats_fd, Error **errp) > + strList *names, int stats_fd, Error **errp, > + CPUState *cpu) include/qapi/error.h: * - Functions that use Error to report errors have an Error **errp * parameter. It should be the last parameter, except for functions * taking variable arguments. > { > struct kvm_stats_desc *kvm_stats_desc; > struct kvm_stats_header *kvm_stats_header; [...]