Skip to content

Commit

Permalink
Documentation: power: Describe 'advanced' and 'simple' EM models
Browse files Browse the repository at this point in the history
The Energy Model (EM) can be registered in two ways:

 1) Using a helper function, which under the hood relies on OPP framework
    and DT entry in CPU node: 'dynamic-power-coefficient'. This is
    a 'simple' EM because it's tied to the math formula:
    Power = dynamic-power-coefficient * V^2 * f

 2) Using em_dev_register_perf_domain() API function with a driver
    custom callback which provides power for each performance state.

    This is 'advanced' EM, since it can better reflect real power
    measurements for each performance state. It's not limited to any
    math formula and can better reflect real physics of the device.

Add description of these two methods to the documentation, so developers
could choose the suitable registration method (option).

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lukasz Luba authored and Rafael J. Wysocki committed Nov 10, 2021
1 parent d704aa0 commit 0837441
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Documentation/power/energy-model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ CONFIG_ENERGY_MODEL must be enabled to use the EM framework.
2.2 Registration of performance domains
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Registration of 'advanced' EM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The 'advanced' EM gets it's name due to the fact that the driver is allowed
to provide more precised power model. It's not limited to some implemented math
formula in the framework (like it's in 'simple' EM case). It can better reflect
the real power measurements performed for each performance state. Thus, this
registration method should be preferred in case considering EM static power
(leakage) is important.

Drivers are expected to register performance domains into the EM framework by
calling the following API::

Expand All @@ -103,6 +113,18 @@ to: return warning/error, stop working or panic.
See Section 3. for an example of driver implementing this
callback, or Section 2.4 for further documentation on this API

Registration of 'simple' EM
~~~~~~~~~~~~~~~~~~~~~~~~~~~

The 'simple' EM is registered using the framework helper function
cpufreq_register_em_with_opp(). It implements a power model which is tight to
math formula::

Power = C * V^2 * f

The EM which is registered using this method might not reflect correctly the
physics of a real device, e.g. when static power (leakage) is important.


2.3 Accessing performance domains
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 0837441

Please sign in to comment.