• D
    kvm: add halt-polling cpu usage stats · cb953129
    David Matlack 提交于
    Two new stats for exposing halt-polling cpu usage:
    halt_poll_success_ns
    halt_poll_fail_ns
    
    Thus sum of these 2 stats is the total cpu time spent polling. "success"
    means the VCPU polled until a virtual interrupt was delivered. "fail"
    means the VCPU had to schedule out (either because the maximum poll time
    was reached or it needed to yield the CPU).
    
    To avoid touching every arch's kvm_vcpu_stat struct, only update and
    export halt-polling cpu usage stats if we're on x86.
    
    Exporting cpu usage as a u64 and in nanoseconds means we will overflow at
    ~500 years, which seems reasonably large.
    Signed-off-by: NDavid Matlack <dmatlack@google.com>
    Signed-off-by: NJon Cargille <jcargill@google.com>
    Reviewed-by: NJim Mattson <jmattson@google.com>
    
    Message-Id: <20200508182240.68440-1-jcargill@google.com>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    cb953129
kvm_main.c 117.3 KB