tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 3 Oct 2023 21:46:30 +0000 (14:46 -0700)
committerSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tue, 17 Oct 2023 18:55:37 +0000 (11:55 -0700)
commit3bc0f20a8c59daa79aee2da119564f668f458afd
treeed24a1c69eb98cafaf2a875fb4a9cf1c94fad15e
parentbc5370cca03ba9d1634fecd85e0cf99a0a3c0483
tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0

From kernel version 6.5, CPU 0 hotplug capability is deprecated.
If some SST profile doesn't have CPU 0, then it is no longer possible to
offline CPU 0. This means that user space threads will still run on
CPU 0.

To workaround this issue, use cgroup v2 isolation feature. Whenever there
/sys/devices/system/cpu/cpu0/online file is absent or open fails, isolate
CPU 0 via CPU cgroup v2 isolation. Also add a command line option to
force even if the /sys/devices/system/cpu/cpu0/online is present.

The previous commit "01bcb56f059e ("tools/power/x86/intel-speed-select:
Prevent CPU 0 offline") was just warning about this issue based on the
kernel version 6.5 and above. With this new approach, instead of warning
take action to mitigate the issue.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
tools/power/x86/intel-speed-select/isst-config.c
tools/power/x86/intel-speed-select/isst-daemon.c
tools/power/x86/intel-speed-select/isst.h