[RFC PATCH 0/4] Introduce a interface to query cpu status map

Teddy Astie posted 4 patches 1 month, 2 weeks ago
Only 1 patches received!
tools/include/libxl.h            | 11 ++++++
tools/include/xenctrl.h          |  4 ++
tools/libs/ctrl/xc_misc.c        | 45 +++++++++++++++++++++
tools/libs/light/libxl.c         | 39 +++++++++++++++++++
tools/libs/light/libxl_types.idl |  6 +++
tools/misc/xenpm.c               | 67 ++++++++++++++++++++++++++++----
tools/xl/xl_cmdtable.c           |  4 +-
tools/xl/xl_info.c               | 46 ++++++++++++++++++++--
xen/common/sysctl.c              | 34 ++++++++++++++++
xen/include/public/sysctl.h      | 13 +++++++
xen/xsm/flask/hooks.c            |  1 +
11 files changed, 258 insertions(+), 12 deletions(-)
[RFC PATCH 0/4] Introduce a interface to query cpu status map
Posted by Teddy Astie 1 month, 2 weeks ago
Hello, this is originally meant to make xenpm get-core-temp more
robust, but happens to also be useful in other cases.

CPUs can offline for various reasons including hot-pluggable CPUs
(possible CPUs) or through explicit offlining with xen-hptool
(present but offline). However, there is no way to probe which CPU
is in which state outside of Xen itself (cpu_online_map and other
maps).

That leads to problems in some cases as xenpm get-core-temp may try
to query CPU temperature of offline CPUs (leading to ENODEV) or
observe a incorrect cores_per_socket (if offline CPUs are a part of
the first socket), leading to inconsistent package temperatures
reporting.

The first commit expose a new sysctl to query the cpu_online_map,
cpu_present_map and cpu_possible_map bitmaps.

The 2 following commits add a matching interface in xl and new
`xl info -m` to get the CPU status map (Online/Offline status
of each pCPU).

And the latest commit reworks xenpm get-core-temp core/socket
selection logic to properly handle cases when CPUs are brought
offline and be more robust against some complicated CPU topologies.

This can be trivially tested using `xen-hptool cpu-{on,off}line N` to
bring a CPU offline along with `xl info -m` and `xenpm get-core-temp`
to observe it.

Teddy Astie (4):
  sysctl: Introduce XEN_SYSCTL_get_cpu_status_map
  libxl: Introduce CPU status map interface
  xl: Expose CPU status map with 'xl info -m'
  xenpm: Rework get-core-temp around CPU status map and topology

 tools/include/libxl.h            | 11 ++++++
 tools/include/xenctrl.h          |  4 ++
 tools/libs/ctrl/xc_misc.c        | 45 +++++++++++++++++++++
 tools/libs/light/libxl.c         | 39 +++++++++++++++++++
 tools/libs/light/libxl_types.idl |  6 +++
 tools/misc/xenpm.c               | 67 ++++++++++++++++++++++++++++----
 tools/xl/xl_cmdtable.c           |  4 +-
 tools/xl/xl_info.c               | 46 ++++++++++++++++++++--
 xen/common/sysctl.c              | 34 ++++++++++++++++
 xen/include/public/sysctl.h      | 13 +++++++
 xen/xsm/flask/hooks.c            |  1 +
 11 files changed, 258 insertions(+), 12 deletions(-)

-- 
2.55.0



-- 
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech