doc: cpu_freq: add details about on-demand policy

add details about on-demand policy

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
This commit is contained in:
Zhaoxiang Jin
2025-10-30 19:10:02 +08:00
committed by Anas Nashif
parent 26f773fb72
commit e5c0abb43b

View File

@@ -7,8 +7,13 @@ The On-Demand policy evaluates the current CPU load using the
:ref:`CPU Load metric <cpu_load_metric>`, and compares it to the trigger threshold defined by the
SoC P-state definition.
The On-Demand policy will iterate through the defined P-states and select the first P-state of which
the CPU load exceeds the defined threshold.
The On-Demand policy will iterate through the defined P-states and select the first P-state for which
the CPU load is greater than or equal to the defined threshold.
If no P-state matches (i.e., the CPU load is below all thresholds), the policy will select the
last P-state in the soc_pstates array (the lowest performance state). This is intrinsic to the
policy: P-states must be defined in decreasing threshold order in devicetree, and the last
P-state will be used for loads below all thresholds.
For an example of the on-demand policy refer to the :zephyr:code-sample:`cpu_freq_on_demand` sample.