qemu-e2k/qapi
Yanan Wang 864c3b5c32 hw/core/machine: Introduce CPU cluster topology support
The new Cluster-Aware Scheduling support has landed in Linux 5.16,
which has been proved to benefit the scheduling performance (e.g.
load balance and wake_affine strategy) on both x86_64 and AArch64.

So now in Linux 5.16 we have four-level arch-neutral CPU topology
definition like below and a new scheduler level for clusters.
struct cpu_topology {
    int thread_id;
    int core_id;
    int cluster_id;
    int package_id;
    int llc_id;
    cpumask_t thread_sibling;
    cpumask_t core_sibling;
    cpumask_t cluster_sibling;
    cpumask_t llc_sibling;
}

A cluster generally means a group of CPU cores which share L2 cache
or other mid-level resources, and it is the shared resources that
is used to improve scheduler's behavior. From the point of view of
the size range, it's between CPU die and CPU core. For example, on
some ARM64 Kunpeng servers, we have 6 clusters in each NUMA node,
and 4 CPU cores in each cluster. The 4 CPU cores share a separate
L2 cache and a L3 cache tag, which brings cache affinity advantage.

In virtualization, on the Hosts which have pClusters (physical
clusters), if we can design a vCPU topology with cluster level for
guest kernel and have a dedicated vCPU pinning. A Cluster-Aware
Guest kernel can also make use of the cache affinity of CPU clusters
to gain similar scheduling performance.

This patch adds infrastructure for CPU cluster level topology
configuration and parsing, so that the user can specify cluster
parameter if their machines support it.

Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
Message-Id: <20211228092221.21068-3-wangyanan55@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[PMD: Added '(since 7.0)' to @clusters in qapi/machine.json]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2021-12-31 13:42:39 +01:00
..
acpi.json
audio.json audio: add "dbus" audio backend 2021-12-21 10:50:22 +04:00
authz.json
block-core.json nbd: allow reconnect on open, with corresponding new options 2021-12-21 14:52:06 +01:00
block-export.json
block.json
char.json ui/dbus: add chardev backend & interface 2021-12-21 10:50:22 +04:00
common.json monitor: introduce HumanReadableText and HMP support 2021-11-02 15:55:13 +00:00
compat.json qapi: Extend -compat to set policy for unstable interfaces 2021-10-29 21:28:01 +02:00
control.json
crypto.json
dump.json
error.json
introspect.json
job.json
machine-target.json
machine.json hw/core/machine: Introduce CPU cluster topology support 2021-12-31 13:42:39 +01:00
meson.build monitor: introduce HumanReadableText and HMP support 2021-11-02 15:55:13 +00:00
migration.json docs: fix 'sample-pages' option tag 2021-11-09 08:38:06 +01:00
misc-target.json numa: Support SGX numa in the monitor and Libvirt interfaces 2021-12-10 09:47:18 +01:00
misc.json ui/dbus: add p2p=on/off option 2021-12-21 10:50:22 +04:00
net.json
opts-visitor.c
pci.json
pragma.json
qapi-clone-visitor.c
qapi-dealloc-visitor.c
qapi-forward-visitor.c
qapi-schema.json
qapi-type-helpers.c monitor: introduce HumanReadableText and HMP support 2021-11-02 15:55:13 +00:00
qapi-util.c qapi: Extend -compat to set policy for unstable interfaces 2021-10-29 21:28:01 +02:00
qapi-visit-core.c
qdev.json
qmp-dispatch.c
qmp-event.c
qmp-registry.c
qobject-input-visitor.c
qobject-output-visitor.c qapi: Extend -compat to set policy for unstable interfaces 2021-10-29 21:28:01 +02:00
qom.json qapi/qom,target/i386: sev-guest: Introduce kernel-hashes=on|off option 2021-11-18 11:07:44 +00:00
rdma.json
replay.json
rocker.json
run-state.json
sockets.json
string-input-visitor.c
string-output-visitor.c
tpm.json
trace-events
trace.h
trace.json
transaction.json qapi: deprecate drive-backup 2021-11-09 18:21:19 +01:00
ui.json audio: add "dbus" audio backend 2021-12-21 10:50:22 +04:00
yank.json