0001 .. SPDX-License-Identifier: GPL-2.0
0002
0003 ========================
0004 VCPU Dispatch Statistics
0005 ========================
0006
0007 For Shared Processor LPARs, the POWER Hypervisor maintains a relatively
0008 static mapping of the LPAR processors (vcpus) to physical processor
0009 chips (representing the "home" node) and tries to always dispatch vcpus
0010 on their associated physical processor chip. However, under certain
0011 scenarios, vcpus may be dispatched on a different processor chip (away
0012 from its home node).
0013
0014 /proc/powerpc/vcpudispatch_stats can be used to obtain statistics
0015 related to the vcpu dispatch behavior. Writing '1' to this file enables
0016 collecting the statistics, while writing '0' disables the statistics.
0017 By default, the DTLB log for each vcpu is processed 50 times a second so
0018 as not to miss any entries. This processing frequency can be changed
0019 through /proc/powerpc/vcpudispatch_stats_freq.
0020
0021 The statistics themselves are available by reading the procfs file
0022 /proc/powerpc/vcpudispatch_stats. Each line in the output corresponds to
0023 a vcpu as represented by the first field, followed by 8 numbers.
0024
0025 The first number corresponds to:
0026
0027 1. total vcpu dispatches since the beginning of statistics collection
0028
0029 The next 4 numbers represent vcpu dispatch dispersions:
0030
0031 2. number of times this vcpu was dispatched on the same processor as last
0032 time
0033 3. number of times this vcpu was dispatched on a different processor core
0034 as last time, but within the same chip
0035 4. number of times this vcpu was dispatched on a different chip
0036 5. number of times this vcpu was dispatches on a different socket/drawer
0037 (next numa boundary)
0038
0039 The final 3 numbers represent statistics in relation to the home node of
0040 the vcpu:
0041
0042 6. number of times this vcpu was dispatched in its home node (chip)
0043 7. number of times this vcpu was dispatched in a different node
0044 8. number of times this vcpu was dispatched in a node further away (numa
0045 distance)
0046
0047 An example output::
0048
0049 $ sudo cat /proc/powerpc/vcpudispatch_stats
0050 cpu0 6839 4126 2683 30 0 6821 18 0
0051 cpu1 2515 1274 1229 12 0 2509 6 0
0052 cpu2 2317 1198 1109 10 0 2312 5 0
0053 cpu3 2259 1165 1088 6 0 2256 3 0
0054 cpu4 2205 1143 1056 6 0 2202 3 0
0055 cpu5 2165 1121 1038 6 0 2162 3 0
0056 cpu6 2183 1127 1050 6 0 2180 3 0
0057 cpu7 2193 1133 1052 8 0 2187 6 0
0058 cpu8 2165 1115 1032 18 0 2156 9 0
0059 cpu9 2301 1252 1033 16 0 2293 8 0
0060 cpu10 2197 1138 1041 18 0 2187 10 0
0061 cpu11 2273 1185 1062 26 0 2260 13 0
0062 cpu12 2186 1125 1043 18 0 2177 9 0
0063 cpu13 2161 1115 1030 16 0 2153 8 0
0064 cpu14 2206 1153 1033 20 0 2196 10 0
0065 cpu15 2163 1115 1032 16 0 2155 8 0
0066
0067 In the output above, for vcpu0, there have been 6839 dispatches since
0068 statistics were enabled. 4126 of those dispatches were on the same
0069 physical cpu as the last time. 2683 were on a different core, but within
0070 the same chip, while 30 dispatches were on a different chip compared to
0071 its last dispatch.
0072
0073 Also, out of the total of 6839 dispatches, we see that there have been
0074 6821 dispatches on the vcpu's home node, while 18 dispatches were
0075 outside its home node, on a neighbouring chip.