• David Matlack's avatar
    kvm: add halt-polling cpu usage stats · cb953129
    David Matlack authored
    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: default avatarDavid Matlack <dmatlack@google.com>
    Signed-off-by: default avatarJon Cargille <jcargill@google.com>
    Reviewed-by: default avatarJim Mattson <jmattson@google.com>
    
    Message-Id: <20200508182240.68440-1-jcargill@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    cb953129
kvm_host.h 25.7 KB