Skip to content

Commit 82b27a8

Browse files
authored
Merge pull request #51612 from amolnar-rh/TELCODOCS-644
TELCODOCS-644/645: Per-Core Runtime Tuning of power states - CRI-O and PAO/NTO
2 parents 7d7666d + 4a6e7b8 commit 82b27a8

File tree

4 files changed

+142
-6
lines changed

4 files changed

+142
-6
lines changed

modules/cnf-provisioning-real-time-and-low-latency-workloads.adoc

Lines changed: 118 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ status:
231231
runtimeClass: performance-manual
232232
----
233233

234-
* The pod must have the `cpu-load-balancing.crio.io: true` annotation.
235-
236234
The Node Tuning Operator is responsible for the creation of the high-performance runtime handler config snippet under relevant nodes and for creation of the high-performance runtime class under the cluster. It will have the same content as default runtime handler except it enables the CPU load balancing configuration functionality.
237235

238236
To disable the CPU load balancing for the pod, the `Pod` specification must include the following fields:
@@ -325,4 +323,121 @@ spec:
325323
[source,terminal]
326324
----
327325
$ oc apply -f my-performance-profile.yaml
328-
----
326+
----
327+
328+
[id="node-tuning-operator-pod-power-saving-config_{context}"]
329+
== Optional: Power saving configurations
330+
331+
You can enable power savings for a node that has low priority workloads that are colocated with high priority workloads without impacting the latency or throughput of the high priority workloads. Power saving is possible without modifications to the workloads themselves.
332+
333+
[IMPORTANT]
334+
====
335+
The feature is supported on Intel Ice Lake and later generations of Intel CPUs. The capabilities of the processor might impact the latency and throughput of the high priority workloads.
336+
====
337+
338+
When you configure a node with a power saving configuration, you must configure high priority workloads with performance configuration at the pod level, which means that the configuration applies to all the cores used by the pod.
339+
340+
By disabling P-states and C-states at the pod level, you can configure high priority workloads for best performance and lowest latency.
341+
342+
.Power saving configurations
343+
[cols="1,2", options="header"]
344+
|====
345+
|Annotation
346+
|Description
347+
348+
a|[source,yaml]
349+
----
350+
annotations:
351+
cpu-c-states.crio.io: "enable"
352+
cpu-freq-governor.crio.io: "<governor>"
353+
----
354+
|Provides the best performance for a pod by disabling C-states and specifying the governor type for CPU scaling. The `performance` governor is recommended for high priority workloads.
355+
|====
356+
357+
358+
.Prerequisites
359+
360+
* You enabled C-states and OS-controlled P-states in the BIOS
361+
362+
.Procedure
363+
364+
. Generate a `PerformanceProfile` with `per-pod-power-management` set to `true`:
365+
+
366+
[source,terminal]
367+
----
368+
$ podman run --entrypoint performance-profile-creator -v \
369+
/must-gather:/must-gather:z registry.redhat.io/openshift4/performance-addon-rhel8-operator:v4.11 \
370+
--mcp-name=worker-cnf --reserved-cpu-count=20 --rt-kernel=true \
371+
--split-reserved-cpus-across-numa=false --topology-manager-policy=single-numa-node \
372+
--must-gather-dir-path /must-gather -power-consumption-mode=low-latency \ <1>
373+
--per-pod-power-management=true > my-performance-profile.yaml
374+
----
375+
<1> The `power-consumption-mode` must be `default` or `low-latency` when the `per-pod-power-management` is set to `true`.
376+
377+
+
378+
.Example `PerformanceProfile` with `perPodPowerManagement`
379+
380+
[source,yaml]
381+
----
382+
apiVersion: performance.openshift.io/v2
383+
kind: PerformanceProfile
384+
metadata:
385+
name: performance
386+
spec:
387+
[.....]
388+
workloadHints:
389+
realTime: true
390+
highPowerConsumption: false
391+
perPodPowerManagement: true
392+
----
393+
394+
. Set the default `cpufreq` governor as an additional kernel argument in the `PerformanceProfile` custom resource (CR):
395+
+
396+
[source,yaml]
397+
----
398+
apiVersion: performance.openshift.io/v2
399+
kind: PerformanceProfile
400+
metadata:
401+
name: performance
402+
spec:
403+
...
404+
additionalKernelArgs:
405+
- cpufreq.default_governor=schedutil <1>
406+
----
407+
<1> Using the `schedutil` governor is recommended, however, you can use other governors such as the `ondemand` or `powersave` governors.
408+
409+
. Set the maximum CPU frequency in the `TunedPerformancePatch` CR:
410+
+
411+
[source,yaml]
412+
----
413+
spec:
414+
profile:
415+
- data: |
416+
[sysfs]
417+
/sys/devices/system/cpu/intel_pstate/max_perf_pct = <x> <1>
418+
----
419+
<1> The `max_perf_pct` controls the maximum frequency the `cpufreq` driver is allowed to set as a percentage of the maximum supported cpu frequency. This value applies to all CPUs. You can check the maximum supported frequency in `/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`.
420+
421+
422+
. Add the desired annotations to your pods. The annotations override the `default` settings.
423+
+
424+
.Example power saving annotation
425+
[source,yaml]
426+
----
427+
apiVersion: v1
428+
kind: Pod
429+
metadata:
430+
...
431+
annotations:
432+
...
433+
cpu-c-states.crio.io: "enable"
434+
cpu-freq-governor.crio.io: "<governor>"
435+
...
436+
...
437+
spec:
438+
...
439+
runtimeClassName: performance-<profile_name>
440+
...
441+
----
442+
443+
. Restart the pods.

modules/cnf-understanding-workload-hints.adoc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,15 @@ realTime: true
4949
| Far edge clusters, latency critical workloads
5050
| Optimized for absolute minimal latency and maximum determinism at the cost of increased power consumption.
5151

52-
|===
52+
| Per-pod power management
53+
a|[source,terminal]
54+
----
55+
workloadHints:
56+
realTime: true
57+
highPowerConsumption: false
58+
perPodPowerManagement: true
59+
----
60+
| Critical and non-critical workloads
61+
| Allows for power management per pod.
62+
63+
|===

modules/ztp-du-bios-config-reference.adoc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ The following table is a general recommendation for vDU cluster host BIOS config
6565
|Disable Energy Efficient Turbo to prevent the processor from using an energy-efficiency based policy.
6666

6767
|Hardware P-States
68-
|Disabled
69-
|Disable `P-states` (performance states) to optimize the operating system and CPU for performance over power consumption.
68+
|Enabled or Disabled
69+
|Enable OS-controlled P-States to allow power saving configurations. Disable `P-states` (performance states) to optimize the operating system and CPU for performance over power consumption.
7070

7171
|Package C-State
7272
|C0/C1 state
@@ -89,3 +89,8 @@ The following table is a general recommendation for vDU cluster host BIOS config
8989
====
9090
Enable global SR-IOV and VT-d settings in the BIOS for the host. These settings are relevant to bare-metal environments.
9191
====
92+
93+
[NOTE]
94+
====
95+
Enable both `C-states` and OS-controlled `P-States` to allow per pod power management.
96+
====

scalability_and_performance/cnf-low-latency-tuning.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ include::modules/cnf-about_hyperthreading_for_low_latency_and_real_time_applicat
1717
1818
include::modules/cnf-provisioning-real-time-and-low-latency-workloads.adoc[leveloffset=+1]
1919

20+
[role="_additional-resources"]
21+
.Additional resources
22+
23+
* For more information about recommended BIOS configuration, see xref:../scalability_and_performance/ztp-vdu-validating-cluster-tuning.adoc#ztp-du-bios-config-reference_vdu-config-ref[Recommended BIOS configuration for vDU cluster hosts].
24+
2025
include::modules/cnf-managing-device-interrupt-processing-for-guaranteed-pod-isolated-cpus.adoc[leveloffset=+2]
2126

2227
include::modules/cnf-use-device-interrupt-processing-for-isolated-cpus.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)