On Wed, Feb 07, 2018 at 12:50:13PM -0500, Luiz Capitulino wrote:
The query-cpus command has an extremely serious side effect:
it always interrupt all running vCPUs so that they can run
ioctl calls. This can cause a huge performance degradation for
some workloads. And most of the information retrieved by the
ioctl calls are not even used by query-cpus.
This commit introduces a replacement for query-cpus called
query-cpus-fast, which has the following features:
+# Notes: @halted is a transient state that changes frequently. By the time the
+# data is sent to the client, the guest may no longer be halted.
+##
+{ 'struct': 'CpuInfo2',
+ 'data': {'cpu-index': 'int', '*halted': 'bool', 'qom-path': 'str',
+ 'thread-id': 'int', '*props': 'CpuInstanceProperties' } }
This will require duplicating struct fields every time we add a
new field to query-cpus-fast (e.g. how would VIktor's
CpuInfoS390State patch[1] look like if rebased on top of yours?).
One way to avoid that is to use CpuInfo for both, and make all
"slow" fields optional. Another option is to use QAPI
inheritance, but it could be a little complicated if unions are
involved?