• Naveen N. Rao's avatar
    powerpc/pseries: Provide vcpu dispatch statistics · d62c8dee
    Naveen N. Rao authored
    For Shared Processor LPARs, the POWER Hypervisor maintains a
    relatively static mapping of the LPAR processors (vcpus) to physical
    processor chips (representing the "home" node) and tries to always
    dispatch vcpus on their associated physical processor chip. However,
    under certain scenarios, vcpus may be dispatched on a different
    processor chip (away from its home node). The actual physical
    processor number on which a certain vcpu is dispatched is available to
    the guest in the 'processor_id' field of each DTL entry.
    
    The guest can discover the home node of each vcpu through the
    H_HOME_NODE_ASSOCIATIVITY(flags=1) hcall. The guest can also discover
    the associativity of physical processors, as represented in the DTL
    entry, through the H_HOME_NODE_ASSOCIATIVITY(flags=2) hcall.
    
    These can then be compared to determine if the vcpu was dispatched on
    its home node or not. If the vcpu was not dispatched on the home node,
    it is possible to determine if the vcpu was dispatched in a different
    chip, socket or drawer.
    
    Introduce a procfs file /proc/powerpc/vcpudispatch_stats that can be
    used to obtain these statistics. Writing '1' to this file enables
    collecting the statistics, while writing '0' disables the statistics.
    The statistics themselves are available by reading the procfs file. By
    default, the DTLB log for each vcpu is processed 50 times a second so
    as not to miss any entries. This processing frequency can be changed
    through /proc/powerpc/vcpudispatch_stats_freq.
    Signed-off-by: default avatarNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    d62c8dee
topology.h 3.3 KB