• Suraj Jitindar Singh's avatar
    KVM: PPC: Implement existing and add new halt polling vcpu stats · 2a27f514
    Suraj Jitindar Singh authored
    vcpu stats are used to collect information about a vcpu which can be viewed
    in the debugfs. For example halt_attempted_poll and halt_successful_poll
    are used to keep track of the number of times the vcpu attempts to and
    successfully polls. These stats are currently not used on powerpc.
    
    Implement incrementation of the halt_attempted_poll and
    halt_successful_poll vcpu stats for powerpc. Since these stats are summed
    over all the vcpus for all running guests it doesn't matter which vcpu
    they are attributed to, thus we choose the current runner vcpu of the
    vcore.
    
    Also add new vcpu stats: halt_poll_success_ns, halt_poll_fail_ns and
    halt_wait_ns to be used to accumulate the total time spend polling
    successfully, polling unsuccessfully and waiting respectively, and
    halt_successful_wait to accumulate the number of times the vcpu waits.
    Given that halt_poll_success_ns, halt_poll_fail_ns and halt_wait_ns are
    expressed in nanoseconds it is necessary to represent these as 64-bit
    quantities, otherwise they would overflow after only about 4 seconds.
    
    Given that the total time spend either polling or waiting will be known and
    the number of times that each was done, it will be possible to determine
    the average poll and wait times. This will give the ability to tune the kvm
    module parameters based on the calculated average wait and poll times.
    Signed-off-by: default avatarSuraj Jitindar Singh <sjitindarsingh@gmail.com>
    Reviewed-by: default avatarDavid Matlack <dmatlack@google.com>
    Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
    2a27f514
book3s_hv.c 91.1 KB