1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
ppc64 tcg guests get incorrect Capacity Entitlement values from SMP spapr machine's RTAS - examples given from AIX guest OS
Description of problem:
Entitled Capacity of the guest OS is not equal to the number of vCPUs you configure with QEMU.
It only gives you 1/4 entitlements to your configured capacity, and if you increase the number of processors, it converts the LPAR capacity to hundredths of a core, throttling guest performance.
Steps to reproduce:
Definition of terms from lparstat:
Entitled Capacity: The number of processing units this LPAR is entitled to receive.
Maximum Capacity: The maximum number of processing units this LPAR was defined to ever have. Entitled capacity can be increased up to this value.
Some examples:
1 QEMU vCPU:
Entitled Capacity: 0.25
Maximum Capacity: 1.00
2 QEMU vCPUs (-smp cpus=2,sockets=1,cores=2,threads=1):
Entitled Capacity = 0.50
Maximum Capacity: 0.02
3 QEMU CPUs (-smp cpus=3,sockets=1,cores=3,threads=1):
Entitled Capacity = 0.75
Maximum Capacity: 0.03
4 QEMU CPUs (-smp cpus=4,sockets=1,cores=4,threads=1):
Entitled Capacity = 1.00
Maximum Capacity: 0.04
I believe these Entitled and Maximum values are comming from the spapr machine's MaxEntCap, DesProcs and MaxPlatProcs settings which get affected by -smp passed to QEMU.
Additional information:
Details:
1 QEMU vCPU:
```
kens@aix-ppc64$ lparstat -i | head -20
Node Name : aix-ppc64
Partition Name : IBM AIX - IBM POWER9
Partition Number : 0
Type : Shared
Mode : Capped
Entitled Capacity : 0.25
Partition Group-ID : 1
Shared Pool ID : 1
Online Virtual CPUs : 1
Maximum Virtual CPUs : 1
Minimum Virtual CPUs : 1
Online Memory : 8192 MB
Maximum Memory : 8192 MB
Minimum Memory : 8192 MB
Variable Capacity Weight : 128
Minimum Capacity : 0.01
Maximum Capacity : 1.00
Capacity Increment : 1.00
Maximum Physical CPUs in system : 1
Active Physical CPUs in system : 1
```
2 QEMU vCPUs:
```
kens@aix-ppc64$ lparstat -i | head -20
Node Name : aix-ppc64
Partition Name : IBM AIX - IBM POWER9
Partition Number : 0
Type : Shared
Mode : Capped
Entitled Capacity : 0.50
Partition Group-ID : 1
Shared Pool ID : 1
Online Virtual CPUs : 2
Maximum Virtual CPUs : 2
Minimum Virtual CPUs : 2
Online Memory : 8192 MB
Maximum Memory : 8192 MB
Minimum Memory : 8192 MB
Variable Capacity Weight : 128
Minimum Capacity : 0.02
Maximum Capacity : 0.02
Capacity Increment : 1.00
Maximum Physical CPUs in system : 2
Active Physical CPUs in system : 2
```
3 QEMU vCPUs:
```
kens@aix-ppc64$ lparstat -i | head -20
Node Name : aix-ppc64
Partition Name : IBM AIX - IBM POWER9
Partition Number : 0
Type : Shared
Mode : Capped
Entitled Capacity : 0.75
Partition Group-ID : 1
Shared Pool ID : 1
Online Virtual CPUs : 3
Maximum Virtual CPUs : 3
Minimum Virtual CPUs : 3
Online Memory : 8192 MB
Maximum Memory : 8192 MB
Minimum Memory : 8192 MB
Variable Capacity Weight : 128
Minimum Capacity : 0.03
Maximum Capacity : 0.03
Capacity Increment : 1.00
Maximum Physical CPUs in system : 3
Active Physical CPUs in system : 3
```
4 QEMU vCPUs:
```
kens@aix-ppc64$ lparstat -i | head -2
lparstat -i | head -2
Node Name : aix-ppc64
Partition Name : IBM AIX - IBM POWER9
kens@aix-ppc64$ lparstat -i | head -20
lparstat -i | head -20
Node Name : aix-ppc64
Partition Name : IBM AIX - IBM POWER9
Partition Number : 0
Type : Shared
Mode : Capped
Entitled Capacity : 1.00
Partition Group-ID : 1
Shared Pool ID : 1
Online Virtual CPUs : 4
Maximum Virtual CPUs : 4
Minimum Virtual CPUs : 4
Online Memory : 8192 MB
Maximum Memory : 8192 MB
Minimum Memory : 8192 MB
Variable Capacity Weight : 128
Minimum Capacity : 0.04
Maximum Capacity : 0.04
Capacity Increment : 1.00
Maximum Physical CPUs in system : 4
Active Physical CPUs in system : 4
```
So it seems to me like the OS assumes the following from the spapr machine settings:
Entitled Capacity = cpus / 4 (OS is assuming smt=4 threads maybe, see below)
Maximim Capacity = cpus / 100 (OS is assuming hundredths of a core, even though the Capacity Increment is 1.00, see below))
On a real Power system (POWER8, smt=8), it looks like this:
```
kens@aix72$ lparstat -i | head -20
Node Name : aix72
Partition Name : n1
Partition Number : 1
Type : Shared-SMT-4
Mode : Uncapped
Entitled Capacity : 6.00
Partition Group-ID : 32784
Shared Pool ID : 0
Online Virtual CPUs : 12
Maximum Virtual CPUs : 28
Minimum Virtual CPUs : 1
Online Memory : 131072 MB
Maximum Memory : 196608 MB
Minimum Memory : 1024 MB
Variable Capacity Weight : 128
Minimum Capacity : 0.50
Maximum Capacity : 14.00
Capacity Increment : 0.01
Maximum Physical CPUs in system : 80
Active Physical CPUs in system : 80
```
|