sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget&/translations/zh_CN/power/energy-modelmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/zh_TW/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/it_IT/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ja_JP/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/ko_KR/power/energy-modelmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget&/translations/sp_SP/power/energy-modelmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh@/var/lib/git/docbuild/linux/Documentation/power/energy-model.rsthKubhsection)}(hhh](htitle)}(hEnergy Model of devicesh]hEnergy Model of devices}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h 1. Overviewh]h 1. Overview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hThe Energy Model (EM) framework serves as an interface between drivers knowing the power consumed by devices at various performance levels, and the kernel subsystems willing to use that information to make energy-aware decisions.h]hThe Energy Model (EM) framework serves as an interface between drivers knowing the power consumed by devices at various performance levels, and the kernel subsystems willing to use that information to make energy-aware decisions.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hXFThe source of the information about the power consumed by devices can vary greatly from one platform to another. These power costs can be estimated using devicetree data in some cases. In others, the firmware will know better. Alternatively, userspace might be best positioned. And so on. In order to avoid each and every client subsystem to re-implement support for each and every possible source of information on its own, the EM framework intervenes as an abstraction layer which standardizes the format of power cost tables in the kernel, hence enabling to avoid redundant work.h]hXFThe source of the information about the power consumed by devices can vary greatly from one platform to another. These power costs can be estimated using devicetree data in some cases. In others, the firmware will know better. Alternatively, userspace might be best positioned. And so on. In order to avoid each and every client subsystem to re-implement support for each and every possible source of information on its own, the EM framework intervenes as an abstraction layer which standardizes the format of power cost tables in the kernel, hence enabling to avoid redundant work.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXThe power values might be expressed in micro-Watts or in an 'abstract scale'. Multiple subsystems might use the EM and it is up to the system integrator to check that the requirements for the power value scale types are met. An example can be found in the Energy-Aware Scheduler documentation Documentation/scheduler/sched-energy.rst. For some subsystems like thermal or powercap power values expressed in an 'abstract scale' might cause issues. These subsystems are more interested in estimation of power used in the past, thus the real micro-Watts might be needed. An example of these requirements can be found in the Intelligent Power Allocation in Documentation/driver-api/thermal/power_allocator.rst. Kernel subsystems might implement automatic detection to check whether EM registered devices have inconsistent scale (based on EM internal flag). Important thing to keep in mind is that when the power values are expressed in an 'abstract scale' deriving real energy in micro-Joules would not be possible.h]hXThe power values might be expressed in micro-Watts or in an ‘abstract scale’. Multiple subsystems might use the EM and it is up to the system integrator to check that the requirements for the power value scale types are met. An example can be found in the Energy-Aware Scheduler documentation Documentation/scheduler/sched-energy.rst. For some subsystems like thermal or powercap power values expressed in an ‘abstract scale’ might cause issues. These subsystems are more interested in estimation of power used in the past, thus the real micro-Watts might be needed. An example of these requirements can be found in the Intelligent Power Allocation in Documentation/driver-api/thermal/power_allocator.rst. Kernel subsystems might implement automatic detection to check whether EM registered devices have inconsistent scale (based on EM internal flag). Important thing to keep in mind is that when the power values are expressed in an ‘abstract scale’ deriving real energy in micro-Joules would not be possible.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe figure below depicts an example of drivers (Arm-specific here, but the approach is applicable to any architecture) providing power costs to the EM framework, and interested clients reading the data from it::h]hThe figure below depicts an example of drivers (Arm-specific here, but the approach is applicable to any architecture) providing power costs to the EM framework, and interested clients reading the data from it:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubh literal_block)}(hX+---------------+ +-----------------+ +---------------+ | Thermal (IPA) | | Scheduler (EAS) | | Other | +---------------+ +-----------------+ +---------------+ | | em_cpu_energy() | | | em_cpu_get() | +---------+ | +---------+ | | | v v v +---------------------+ | Energy Model | | Framework | +---------------------+ ^ ^ ^ | | | em_dev_register_perf_domain() +----------+ | +---------+ | | | +---------------+ +---------------+ +--------------+ | cpufreq-dt | | arm_scmi | | Other | +---------------+ +---------------+ +--------------+ ^ ^ ^ | | | +--------------+ +---------------+ +--------------+ | Device Tree | | Firmware | | ? | +--------------+ +---------------+ +--------------+h]hX+---------------+ +-----------------+ +---------------+ | Thermal (IPA) | | Scheduler (EAS) | | Other | +---------------+ +-----------------+ +---------------+ | | em_cpu_energy() | | | em_cpu_get() | +---------+ | +---------+ | | | v v v +---------------------+ | Energy Model | | Framework | +---------------------+ ^ ^ ^ | | | em_dev_register_perf_domain() +----------+ | +---------+ | | | +---------------+ +---------------+ +--------------+ | cpufreq-dt | | arm_scmi | | Other | +---------------+ +---------------+ +--------------+ ^ ^ ^ | | | +--------------+ +---------------+ +--------------+ | Device Tree | | Firmware | | ? | +--------------+ +---------------+ +--------------+}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhK*hhhhubh)}(hXIn case of CPU devices the EM framework manages power cost tables per 'performance domain' in the system. A performance domain is a group of CPUs whose performance is scaled together. Performance domains generally have a 1-to-1 mapping with CPUFreq policies. All CPUs in a performance domain are required to have the same micro-architecture. CPUs in different performance domains can have different micro-architectures.h]hXIn case of CPU devices the EM framework manages power cost tables per ‘performance domain’ in the system. A performance domain is a group of CPUs whose performance is scaled together. Performance domains generally have a 1-to-1 mapping with CPUFreq policies. All CPUs in a performance domain are required to have the same micro-architecture. CPUs in different performance domains can have different micro-architectures.}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChhhhubh)}(hXTo better reflect power variation due to static power (leakage) the EM supports runtime modifications of the power values. The mechanism relies on RCU to free the modifiable EM perf_state table memory. Its user, the task scheduler, also uses RCU to access this memory. The EM framework provides API for allocating/freeing the new memory for the modifiable EM table. The old memory is freed automatically using RCU callback mechanism when there are no owners anymore for the given EM runtime table instance. This is tracked using kref mechanism. The device driver which provided the new EM at runtime, should call EM API to free it safely when it's no longer needed. The EM framework will handle the clean-up when it's possible.h]hXTo better reflect power variation due to static power (leakage) the EM supports runtime modifications of the power values. The mechanism relies on RCU to free the modifiable EM perf_state table memory. Its user, the task scheduler, also uses RCU to access this memory. The EM framework provides API for allocating/freeing the new memory for the modifiable EM table. The old memory is freed automatically using RCU callback mechanism when there are no owners anymore for the given EM runtime table instance. This is tracked using kref mechanism. The device driver which provided the new EM at runtime, should call EM API to free it safely when it’s no longer needed. The EM framework will handle the clean-up when it’s possible.}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKJhhhhubh)}(hThe kernel code which want to modify the EM values is protected from concurrent access using a mutex. Therefore, the device driver code must run in sleeping context when it tries to modify the EM.h]hThe kernel code which want to modify the EM values is protected from concurrent access using a mutex. Therefore, the device driver code must run in sleeping context when it tries to modify the EM.}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhhhhubh)}(hWith the runtime modifiable EM we switch from a 'single and during the entire runtime static EM' (system property) design to a 'single EM which can be changed during runtime according e.g. to the workload' (system and workload property) design.h]hWith the runtime modifiable EM we switch from a ‘single and during the entire runtime static EM’ (system property) design to a ‘single EM which can be changed during runtime according e.g. to the workload’ (system and workload property) design.}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhhhhubh)}(hIt is possible also to modify the CPU performance values for each EM's performance state. Thus, the full power and performance profile (which is an exponential curve) can be changed according e.g. to the workload or system property.h]hIt is possible also to modify the CPU performance values for each EM’s performance state. Thus, the full power and performance profile (which is an exponential curve) can be changed according e.g. to the workload or system property.}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hhhhubeh}(h]overviewah ]h"] 1. overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h 2. Core APIsh]h 2. Core APIs}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrhhhhhKeubh)}(hhh](h)}(h2.1 Config optionsh]h2.1 Config options}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKhubh)}(h tuples for each performance state. The callback function provided by the driver is free to fetch data from any relevant location (DT, firmware, ...), and by any mean deemed necessary. Only for CPU devices, drivers must specify the CPUs of the performance domains using cpumask. For other devices than CPUs the last argument must be set to NULL. The last argument 'microwatts' is important to set with correct value. Kernel subsystems which use EM might rely on this flag to check if all EM devices use the same scale. If there are different scales, these subsystems might decide 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 APIh]hX5Drivers must provide a callback function returning tuples for each performance state. The callback function provided by the driver is free to fetch data from any relevant location (DT, firmware, ...), and by any mean deemed necessary. Only for CPU devices, drivers must specify the CPUs of the performance domains using cpumask. For other devices than CPUs the last argument must be set to NULL. The last argument ‘microwatts’ is important to set with correct value. Kernel subsystems which use EM might rely on this flag to check if all EM devices use the same scale. If there are different scales, these subsystems might decide 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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]registration-of-advanced-emah ]h"]registration of 'advanced' emah$]h&]uh1hhjhhhhhKqubh)}(hhh](h)}(hRegistration of EM using DTh]hRegistration of EM using DT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hXThe EM can also be registered using OPP framework and information in DT "operating-points-v2". Each OPP entry in DT can be extended with a property "opp-microwatt" containing micro-Watts power value. This OPP DT property allows a platform to register EM power values which are reflecting total power (static + dynamic). These power values might be coming directly from experiments and measurements.h]hXThe EM can also be registered using OPP framework and information in DT “operating-points-v2”. Each OPP entry in DT can be extended with a property “opp-microwatt” containing micro-Watts power value. This OPP DT property allows a platform to register EM power values which are reflecting total power (static + dynamic). These power values might be coming directly from experiments and measurements.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubeh}(h]registration-of-em-using-dtah ]h"]registration of em using dtah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hRegistration of 'artificial' EMh]h#Registration of ‘artificial’ EM}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3hhhhhKubh)}(hXrThere is an option to provide a custom callback for drivers missing detailed knowledge about power value for each performance state. The callback .get_cost() is optional and provides the 'cost' values used by the EAS. This is useful for platforms that only provide information on relative efficiency between CPU types, where one could use the information to create an abstract power model. But even an abstract power model can sometimes be hard to fit in, given the input power value size restrictions. The .get_cost() allows to provide the 'cost' values which reflect the efficiency of the CPUs. This would allow to provide EAS information which has different relation than what would be forced by the EM internal formulas calculating 'cost' values. To register an EM for such platform, the driver must set the flag 'microwatts' to 0, provide .get_power() callback and provide .get_cost() callback. The EM framework would handle such platform properly during registration. A flag EM_PERF_DOMAIN_ARTIFICIAL is set for such platform. Special care should be taken by other frameworks which are using EM to test and treat this flag properly.h]hXThere is an option to provide a custom callback for drivers missing detailed knowledge about power value for each performance state. The callback .get_cost() is optional and provides the ‘cost’ values used by the EAS. This is useful for platforms that only provide information on relative efficiency between CPU types, where one could use the information to create an abstract power model. But even an abstract power model can sometimes be hard to fit in, given the input power value size restrictions. The .get_cost() allows to provide the ‘cost’ values which reflect the efficiency of the CPUs. This would allow to provide EAS information which has different relation than what would be forced by the EM internal formulas calculating ‘cost’ values. To register an EM for such platform, the driver must set the flag ‘microwatts’ to 0, provide .get_power() callback and provide .get_cost() callback. The EM framework would handle such platform properly during registration. A flag EM_PERF_DOMAIN_ARTIFICIAL is set for such platform. Special care should be taken by other frameworks which are using EM to test and treat this flag properly.}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj3hhubeh}(h]registration-of-artificial-emah ]h"]registration of 'artificial' emah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hRegistration of 'simple' EMh]hRegistration of ‘simple’ EM}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZhhhhhKubh)}(hThe '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::h]hThe ‘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:}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjZhhubj)}(hPower = C * V^2 * fh]hPower = C * V^2 * f}hjysbah}(h]h ]h"]h$]h&]hhuh1jhhhKhjZhhubh)}(hThe 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.h]hThe 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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjZhhubeh}(h]registration-of-simple-emah ]h"]registration of 'simple' emah$]h&]uh1hhjhhhhhKubeh}(h]#registration-of-performance-domainsah ]h"]'2.2 registration of performance domainsah$]h&]uh1hhjrhhhhhKnubh)}(hhh](h)}(h!2.3 Accessing performance domainsh]h!2.3 Accessing performance domains}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX:There are two API functions which provide the access to the energy model: em_cpu_get() which takes CPU id as an argument and em_pd_get() with device pointer as an argument. It depends on the subsystem which interface it is going to use, but in case of CPU devices both functions return the same performance domain.h]hX:There are two API functions which provide the access to the energy model: em_cpu_get() which takes CPU id as an argument and em_pd_get() with device pointer as an argument. It depends on the subsystem which interface it is going to use, but in case of CPU devices both functions return the same performance domain.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hSubsystems interested in the energy model of a CPU can retrieve it using the em_cpu_get() API. The energy model tables are allocated once upon creation of the performance domains, and kept in memory untouched.h]hSubsystems interested in the energy model of a CPU can retrieve it using the em_cpu_get() API. The energy model tables are allocated once upon creation of the performance domains, and kept in memory untouched.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX The energy consumed by a performance domain can be estimated using the em_cpu_energy() API. The estimation is performed assuming that the schedutil CPUfreq governor is in use in case of CPU device. Currently this calculation is not provided for other type of devices.h]hX The energy consumed by a performance domain can be estimated using the em_cpu_energy() API. The estimation is performed assuming that the schedutil CPUfreq governor is in use in case of CPU device. Currently this calculation is not provided for other type of devices.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h^More details about the above APIs can be found in ```` or in Section 2.5h](h2More details about the above APIs can be found in }(hjhhhNhNubhliteral)}(h````h]h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh or in Section 2.5}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]accessing-performance-domainsah ]h"]!2.3 accessing performance domainsah$]h&]uh1hhjrhhhhhKubh)}(hhh](h)}(h2.4 Runtime modificationsh]h2.4 Runtime modifications}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(hDrivers willing to update the EM at runtime should use the following dedicated function to allocate a new instance of the modified EM. The API is listed below::h]hDrivers willing to update the EM at runtime should use the following dedicated function to allocate a new instance of the modified EM. The API is listed below:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hFstruct em_perf_table __rcu *em_table_alloc(struct em_perf_domain *pd);h]hFstruct em_perf_table __rcu *em_table_alloc(struct em_perf_domain *pd);}hj)sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hXThis allows to allocate a structure which contains the new EM table with also RCU and kref needed by the EM framework. The 'struct em_perf_table' contains array 'struct em_perf_state state[]' which is a list of performance states in ascending order. That list must be populated by the device driver which wants to update the EM. The list of frequencies can be taken from existing EM (created during boot). The content in the 'struct em_perf_state' must be populated by the driver as well.h]hXThis allows to allocate a structure which contains the new EM table with also RCU and kref needed by the EM framework. The ‘struct em_perf_table’ contains array ‘struct em_perf_state state[]’ which is a list of performance states in ascending order. That list must be populated by the device driver which wants to update the EM. The list of frequencies can be taken from existing EM (created during boot). The content in the ‘struct em_perf_state’ must be populated by the driver as well.}(hj7hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hCThis is the API which does the EM update, using RCU pointers swap::h]hBThis is the API which does the EM update, using RCU pointers swap:}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hoint em_dev_update_perf_domain(struct device *dev, struct em_perf_table __rcu *new_table);h]hoint em_dev_update_perf_domain(struct device *dev, struct em_perf_table __rcu *new_table);}hjSsbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hXDrivers must provide a pointer to the allocated and initialized new EM 'struct em_perf_table'. That new EM will be safely used inside the EM framework and will be visible to other sub-systems in the kernel (thermal, powercap). The main design goal for this API is to be fast and avoid extra calculations or memory allocations at runtime. When pre-computed EMs are available in the device driver, than it should be possible to simply re-use them with low performance overhead.h]hXDrivers must provide a pointer to the allocated and initialized new EM ‘struct em_perf_table’. That new EM will be safely used inside the EM framework and will be visible to other sub-systems in the kernel (thermal, powercap). The main design goal for this API is to be fast and avoid extra calculations or memory allocations at runtime. When pre-computed EMs are available in the device driver, than it should be possible to simply re-use them with low performance overhead.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(h}In order to free the EM, provided earlier by the driver (e.g. when the module is unloaded), there is a need to call the API::h]h|In order to free the EM, provided earlier by the driver (e.g. when the module is unloaded), there is a need to call the API:}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(h6void em_table_free(struct em_perf_table __rcu *table);h]h6void em_table_free(struct em_perf_table __rcu *table);}hj}sbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hqIt will allow the EM framework to safely remove the memory, when there is no other sub-system using it, e.g. EAS.h]hqIt will allow the EM framework to safely remove the memory, when there is no other sub-system using it, e.g. EAS.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hTo use the power values in other sub-systems (like thermal, powercap) there is a need to call API which protects the reader and provide consistency of the EM table data::h]hTo use the power values in other sub-systems (like thermal, powercap) there is a need to call API which protects the reader and provide consistency of the EM table data:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubj)}(hGstruct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd);h]hGstruct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKhj hhubh)}(hXIt returns the 'struct em_perf_state' pointer which is an array of performance states in ascending order. This function must be called in the RCU read lock section (after the rcu_read_lock()). When the EM table is not needed anymore there is a need to call rcu_real_unlock(). In this way the EM safely uses the RCU read section and protects the users. It also allows the EM framework to manage the memory and free it. More details how to use it can be found in Section 3.2 in the example driver.h]hXIt returns the ‘struct em_perf_state’ pointer which is an array of performance states in ascending order. This function must be called in the RCU read lock section (after the rcu_read_lock()). When the EM table is not needed anymore there is a need to call rcu_real_unlock(). In this way the EM safely uses the RCU read section and protects the users. It also allows the EM framework to manage the memory and free it. More details how to use it can be found in Section 3.2 in the example driver.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hSThere is dedicated API for device drivers to calculate em_perf_state::cost values::h]hRThere is dedicated API for device drivers to calculate em_perf_state::cost values:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj hhubj)}(hrint em_dev_compute_costs(struct device *dev, struct em_perf_state *table, int nr_states);h]hrint em_dev_compute_costs(struct device *dev, struct em_perf_state *table, int nr_states);}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhj hhubh)}(hXThese 'cost' values from EM are used in EAS. The new EM table should be passed together with the number of entries and device pointer. When the computation of the cost values is done properly the return value from the function is 0. The function takes care for right setting of inefficiency for each performance state as well. It updates em_perf_state::flags accordingly. Then such prepared new EM can be passed to the em_dev_update_perf_domain() function, which will allow to use it.h]hXThese ‘cost’ values from EM are used in EAS. The new EM table should be passed together with the number of entries and device pointer. When the computation of the cost values is done properly the return value from the function is 0. The function takes care for right setting of inefficiency for each performance state as well. It updates em_perf_state::flags accordingly. Then such prepared new EM can be passed to the em_dev_update_perf_domain() function, which will allow to use it.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj hhubh)}(hMore details about the above APIs can be found in ```` or in Section 3.2 with an example code showing simple implementation of the updating mechanism in a device driver.h](h2More details about the above APIs can be found in }(hjhhhNhNubj)}(h````h]h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhs or in Section 3.2 with an example code showing simple implementation of the updating mechanism in a device driver.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj hhubeh}(h]runtime-modificationsah ]h"]2.4 runtime modificationsah$]h&]uh1hhjrhhhhhKubh)}(hhh](h)}(h#2.5 Description details of this APIh]h#2.5 Description details of this API}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubhindex)}(hhh]h}(h]h ]h"]h$]h&]entries](singleem_perf_state (C struct)c.em_perf_statehNtauh1j&hjhhhNhNubhdesc)}(hhh](hdesc_signature)}(h em_perf_stateh]hdesc_signature_line)}(hstruct em_perf_stateh](hdesc_sig_keyword)}(hstructh]hstruct}(hjJhhhNhNubah}(h]h ]kah"]h$]h&]uh1jHhjDhhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubhdesc_sig_space)}(h h]h }(hj\hhhNhNubah}(h]h ]wah"]h$]h&]uh1jZhjDhhhjYhKubh desc_name)}(h em_perf_stateh]h desc_sig_name)}(hj@h]h em_perf_state}(hjshhhNhNubah}(h]h ]nah"]h$]h&]uh1jqhjmubah}(h]h ](sig-namedescnameeh"]h$]h&]hhuh1jkhjDhhhjYhKubeh}(h]h ]h"]h$]h&]hh add_permalinkuh1jBsphinx_line_type declaratorhj>hhhjYhKubah}(h]j5ah ](sig sig-objecteh"]h$]h&] is_multiline _toc_parts) _toc_namehuh1j<hjYhKhj9hhubh desc_content)}(hhh]h)}(h)Performance state of a performance domainh]h)Performance state of a performance domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjhhubah}(h]h ]h"]h$]h&]uh1jhj9hhhjYhKubeh}(h]h ](cstructeh"]h$]h&]domainjobjtypejdesctypejnoindex noindexentrynocontentsentryuh1j7hhhjhNhNubh container)}(hX**Definition**:: struct em_perf_state { unsigned long performance; unsigned long frequency; unsigned long power; unsigned long cost; unsigned long flags; }; **Members** ``performance`` CPU performance (capacity) at a given frequency ``frequency`` The frequency in KHz, for consistency with CPUFreq ``power`` The power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic. ``cost`` The cost coefficient associated with this level, used during energy calculation. Equal to: power * max_frequency / frequency ``flags`` see "em_perf_state flags" description below.h](h)}(h**Definition**::h](hstrong)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj)}(hstruct em_perf_state { unsigned long performance; unsigned long frequency; unsigned long power; unsigned long cost; unsigned long flags; };h]hstruct em_perf_state { unsigned long performance; unsigned long frequency; unsigned long power; unsigned long cost; unsigned long flags; };}hjsbah}(h]h ]h"]h$]h&]hhuh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubh)}(h **Members**h]j)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubhdefinition_list)}(hhh](hdefinition_list_item)}(h@``performance`` CPU performance (capacity) at a given frequency h](hterm)}(h``performance``h]j)}(hj h]h performance}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubh definition)}(hhh]h)}(h/CPU performance (capacity) at a given frequencyh]h/CPU performance (capacity) at a given frequency}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj5hKhj8ubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhj5hKhjubj)}(hA``frequency`` The frequency in KHz, for consistency with CPUFreq h](j)}(h ``frequency``h]j)}(hj[h]h frequency}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjYubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjUubj7)}(hhh]h)}(h2The frequency in KHz, for consistency with CPUFreqh]h2The frequency in KHz, for consistency with CPUFreq}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhjphKhjqubah}(h]h ]h"]h$]h&]uh1j6hjUubeh}(h]h ]h"]h$]h&]uh1jhjphKhjubj)}(h~``power`` The power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic. h](j)}(h ``power``h]j)}(hjh]hpower}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj7)}(hhh]h)}(hsThe power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic.h]hsThe power consumed at this level (by 1 CPU or by a registered device). It can be a total power: static and dynamic.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(h``cost`` The cost coefficient associated with this level, used during energy calculation. Equal to: power * max_frequency / frequency h](j)}(h``cost``h]j)}(hjh]hcost}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj7)}(hhh]h)}(h|The cost coefficient associated with this level, used during energy calculation. Equal to: power * max_frequency / frequencyh]h|The cost coefficient associated with this level, used during energy calculation. Equal to: power * max_frequency / frequency}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubj)}(h6``flags`` see "em_perf_state flags" description below.h](j)}(h ``flags``h]j)}(hjh]hflags}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj7)}(hhh]h)}(h,see "em_perf_state flags" description below.h]h0see “em_perf_state flags” description below.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3em_perf_table (C struct)c.em_perf_tablehNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(h em_perf_tableh]jC)}(hstruct em_perf_tableh](jI)}(hjLh]hstruct}(hjbhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhj^hhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubj[)}(h h]h }(hjphhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj^hhhjohKubjl)}(h em_perf_tableh]jr)}(hj\h]h em_perf_table}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj~ubah}(h]h ](jjeh"]h$]h&]hhuh1jkhj^hhhjohKubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjZhhhjohKubah}(h]jUah ](jjeh"]h$]h&]jj)jhuh1j<hjohKhjWhhubj)}(hhh]h)}(hPerformance states tableh]hPerformance states table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK+hjhhubah}(h]h ]h"]h$]h&]uh1jhjWhhhjohKubeh}(h]h ](jstructeh"]h$]h&]jjjjjjjjjuh1j7hhhjhNhNubj)}(hX4**Definition**:: struct em_perf_table { struct rcu_head rcu; struct kref kref; struct em_perf_state state[]; }; **Members** ``rcu`` RCU used for safe access and destruction ``kref`` Reference counter to track the users ``state`` List of performance states, in ascending orderh](h)}(h**Definition**::h](j)}(h**Definition**h]h Definition}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK/hjubj)}(hjstruct em_perf_table { struct rcu_head rcu; struct kref kref; struct em_perf_state state[]; };h]hjstruct em_perf_table { struct rcu_head rcu; struct kref kref; struct em_perf_state state[]; };}hjsbah}(h]h ]h"]h$]h&]hhuh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK1hjubh)}(h **Members**h]j)}(hjh]hMembers}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK7hjubj)}(hhh](j)}(h1``rcu`` RCU used for safe access and destruction h](j)}(h``rcu``h]j)}(hjh]hrcu}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK-hj ubj7)}(hhh]h)}(h(RCU used for safe access and destructionh]h(RCU used for safe access and destruction}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj&hK-hj'ubah}(h]h ]h"]h$]h&]uh1j6hj ubeh}(h]h ]h"]h$]h&]uh1jhj&hK-hjubj)}(h.``kref`` Reference counter to track the users h](j)}(h``kref``h]j)}(hjJh]hkref}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK.hjDubj7)}(hhh]h)}(h$Reference counter to track the usersh]h$Reference counter to track the users}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_hK.hj`ubah}(h]h ]h"]h$]h&]uh1j6hjDubeh}(h]h ]h"]h$]h&]uh1jhj_hK.hjubj)}(h8``state`` List of performance states, in ascending orderh](j)}(h ``state``h]j)}(hjh]hstate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK.hj}ubj7)}(hhh]h)}(h.List of performance states, in ascending orderh]h.List of performance states, in ascending order}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK/hjubah}(h]h ]h"]h$]h&]uh1j6hj}ubeh}(h]h ]h"]h$]h&]uh1jhjhK.hjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3em_perf_domain (C struct)c.em_perf_domainhNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(hem_perf_domainh]jC)}(hstruct em_perf_domainh](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjhhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK5ubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjhhhjhK5ubjl)}(hem_perf_domainh]jr)}(hjh]hem_perf_domain}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ](jjeh"]h$]h&]hhuh1jkhjhhhjhK5ubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjhhhjhK5ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j<hjhK5hjhhubj)}(hhh]h)}(hPerformance domainh]hPerformance domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK7hjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhK5ubeh}(h]h ](jstructeh"]h$]h&]jjjj7jj7jjjuh1j7hhhjhNhNubj)}(hX**Definition**:: struct em_perf_domain { struct em_perf_table __rcu *em_table; int nr_perf_states; int min_perf_state; int max_perf_state; unsigned long flags; unsigned long cpus[]; }; **Members** ``em_table`` Pointer to the runtime modifiable em_perf_table ``nr_perf_states`` Number of performance states ``min_perf_state`` Minimum allowed Performance State index ``max_perf_state`` Maximum allowed Performance State index ``flags`` See "em_perf_domain flags" ``cpus`` Cpumask covering the CPUs of the domain. It's here for performance reasons to avoid potential cache misses during energy calculations in the scheduler and simplifies allocating/freeing that memory region.h](h)}(h**Definition**::h](j)}(h**Definition**h]h Definition}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1jhj?ubh:}(hj?hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK;hj;ubj)}(hstruct em_perf_domain { struct em_perf_table __rcu *em_table; int nr_perf_states; int min_perf_state; int max_perf_state; unsigned long flags; unsigned long cpus[]; };h]hstruct em_perf_domain { struct em_perf_table __rcu *em_table; int nr_perf_states; int min_perf_state; int max_perf_state; unsigned long flags; unsigned long cpus[]; };}hj\sbah}(h]h ]h"]h$]h&]hhuh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK=hj;ubh)}(h **Members**h]j)}(hjmh]hMembers}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1jhjkubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKFhj;ubj)}(hhh](j)}(h=``em_table`` Pointer to the runtime modifiable em_perf_table h](j)}(h ``em_table``h]j)}(hjh]hem_table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK9hjubj7)}(hhh]h)}(h/Pointer to the runtime modifiable em_perf_tableh]h/Pointer to the runtime modifiable em_perf_table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK9hjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhK9hjubj)}(h0``nr_perf_states`` Number of performance states h](j)}(h``nr_perf_states``h]j)}(hjh]hnr_perf_states}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK:hjubj7)}(hhh]h)}(hNumber of performance statesh]hNumber of performance states}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhK:hjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhK:hjubj)}(h;``min_perf_state`` Minimum allowed Performance State index h](j)}(h``min_perf_state``h]j)}(hjh]hmin_perf_state}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhK;hjubj7)}(hhh]h)}(h'Minimum allowed Performance State indexh]h'Minimum allowed Performance State index}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hK;hj ubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhj hK;hjubj)}(h;``max_perf_state`` Maximum allowed Performance State index h](j)}(h``max_perf_state``h]j)}(hj7 h]hmax_perf_state}(hj9 hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj5 ubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubah}(h]h ]h"]h$]h&]uh1j6hj ubeh}(h]h ]h"]h$]h&]uh1jhj hK@hjubeh}(h]h ]h"]h$]h&]uh1jhj;ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubh)}(h**Description**h]j)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKDhjhhubh)}(hX4In case of CPU device, a "performance domain" represents a group of CPUs whose performance is scaled together. All CPUs of a performance domain must have the same micro-architecture. Performance domains often have a 1-to-1 mapping with CPUFreq policies. In case of other devices the **cpus** field is unused.h](hXIn case of CPU device, a “performance domain” represents a group of CPUs whose performance is scaled together. All CPUs of a performance domain must have the same micro-architecture. Performance domains often have a 1-to-1 mapping with CPUFreq policies. In case of other devices the }(hj hhhNhNubj)}(h**cpus**h]hcpus}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh field is unused.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKBhjhhubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3&em_pd_get_efficient_state (C function)c.em_pd_get_efficient_statehNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(hnint em_pd_get_efficient_state (struct em_perf_state *table, struct em_perf_domain *pd, unsigned long max_util)h]jC)}(hmint em_pd_get_efficient_state(struct em_perf_state *table, struct em_perf_domain *pd, unsigned long max_util)h](hdesc_sig_keyword_type)}(hinth]hint}(hj> hhhNhNubah}(h]h ]ktah"]h$]h&]uh1j< hj8 hhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubj[)}(h h]h }(hjN hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj8 hhhjM hKubjl)}(hem_pd_get_efficient_stateh]jr)}(hem_pd_get_efficient_stateh]hem_pd_get_efficient_state}(hj` hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj\ ubah}(h]h ](jjeh"]h$]h&]hhuh1jkhj8 hhhjM hKubhdesc_parameterlist)}(hP(struct em_perf_state *table, struct em_perf_domain *pd, unsigned long max_util)h](hdesc_parameter)}(hstruct em_perf_state *tableh](jI)}(hjLh]hstruct}(hj hhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhj| ubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj| ubh)}(hhh]jr)}(h em_perf_stateh]h em_perf_state}(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj ubah}(h]h ]h"]h$]h&] refdomainjreftype identifier reftargetj modnameN classnameN c:parent_keysphinx.domains.c LookupKey)}data]j ASTIdentifier)}j jb sbc.em_pd_get_efficient_stateasbuh1hhj| ubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj| ubhdesc_sig_punctuation)}(h*h]h*}(hj hhhNhNubah}(h]h ]pah"]h$]h&]uh1j hj| ubjr)}(htableh]htable}(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj| ubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjv ubj{ )}(hstruct em_perf_domain *pdh](jI)}(hjLh]hstruct}(hj hhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhj ubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj ubh)}(hhh]jr)}(hem_perf_domainh]hem_perf_domain}(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj modnameN classnameNj j )}j ]j c.em_pd_get_efficient_stateasbuh1hhj ubj[)}(h h]h }(hj: hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj ubj )}(hj h]h*}(hjH hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubjr)}(hpdh]hpd}(hjU hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjv ubj{ )}(hunsigned long max_utilh](j= )}(hunsignedh]hunsigned}(hjn hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjj ubj[)}(h h]h }(hj| hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjj ubj= )}(hlongh]hlong}(hj hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjj ubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjj ubjr)}(hmax_utilh]hmax_util}(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjv ubeh}(h]h ]h"]h$]h&]hhuh1jt hj8 hhhjM hKubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhj4 hhhjM hKubah}(h]j/ ah ](jjeh"]h$]h&]jj)jhuh1j<hjM hKhj1 hhubj)}(hhh]h)}(h.Get an efficient performance state from the EMh]h.Get an efficient performance state from the EM}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj hhubah}(h]h ]h"]h$]h&]uh1jhj1 hhhjM hKubeh}(h]h ](jfunctioneh"]h$]h&]jjjj jj jjjuh1j7hhhjhNhNubj)}(hX**Parameters** ``struct em_perf_state *table`` List of performance states, in ascending order ``struct em_perf_domain *pd`` performance domain for which this must be done ``unsigned long max_util`` Max utilization to map with the EM **Description** It is called from the scheduler code quite frequently and as a consequence doesn't implement any check. **Return** An efficient performance state id, high enough to meet **max_util** requirement.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubj)}(hhh](j)}(hO``struct em_perf_state *table`` List of performance states, in ascending order h](j)}(h``struct em_perf_state *table``h]j)}(hj h]hstruct em_perf_state *table}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubj7)}(hhh]h)}(h.List of performance states, in ascending orderh]h.List of performance states, in ascending order}(hj* hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj& hKhj' ubah}(h]h ]h"]h$]h&]uh1j6hj ubeh}(h]h ]h"]h$]h&]uh1jhj& hKhj ubj)}(hM``struct em_perf_domain *pd`` performance domain for which this must be done h](j)}(h``struct em_perf_domain *pd``h]j)}(hjJ h]hstruct em_perf_domain *pd}(hjL hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjH ubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjD ubj7)}(hhh]h)}(h.performance domain for which this must be doneh]h.performance domain for which this must be done}(hjc hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj_ hKhj` ubah}(h]h ]h"]h$]h&]uh1j6hjD ubeh}(h]h ]h"]h$]h&]uh1jhj_ hKhj ubj)}(h>``unsigned long max_util`` Max utilization to map with the EM h](j)}(h``unsigned long max_util``h]j)}(hj h]hunsigned long max_util}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj} ubj7)}(hhh]h)}(h"Max utilization to map with the EMh]h"Max utilization to map with the EM}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hKhj ubah}(h]h ]h"]h$]h&]uh1j6hj} ubeh}(h]h ]h"]h$]h&]uh1jhj hKhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubh)}(h**Description**h]j)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubh)}(hgIt is called from the scheduler code quite frequently and as a consequence doesn't implement any check.h]hiIt is called from the scheduler code quite frequently and as a consequence doesn’t implement any check.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubh)}(h **Return**h]j)}(hj h]hReturn}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubh)}(hPAn efficient performance state id, high enough to meet **max_util** requirement.h](h7An efficient performance state id, high enough to meet }(hj hhhNhNubj)}(h **max_util**h]hmax_util}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh requirement.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3em_cpu_energy (C function)c.em_cpu_energyhNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(hunsigned long em_cpu_energy (struct em_perf_domain *pd, unsigned long max_util, unsigned long sum_util, unsigned long allowed_cpu_cap)h]jC)}(hunsigned long em_cpu_energy(struct em_perf_domain *pd, unsigned long max_util, unsigned long sum_util, unsigned long allowed_cpu_cap)h](j= )}(hunsignedh]hunsigned}(hj< hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hj8 hhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKubj[)}(h h]h }(hjK hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj8 hhhjJ hKubj= )}(hlongh]hlong}(hjY hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hj8 hhhjJ hKubj[)}(h h]h }(hjg hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj8 hhhjJ hKubjl)}(h em_cpu_energyh]jr)}(h em_cpu_energyh]h em_cpu_energy}(hjy hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhju ubah}(h]h ](jjeh"]h$]h&]hhuh1jkhj8 hhhjJ hKubju )}(hj(struct em_perf_domain *pd, unsigned long max_util, unsigned long sum_util, unsigned long allowed_cpu_cap)h](j{ )}(hstruct em_perf_domain *pdh](jI)}(hjLh]hstruct}(hj hhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhj ubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj ubh)}(hhh]jr)}(hem_perf_domainh]hem_perf_domain}(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj modnameN classnameNj j )}j ]j )}j j{ sbc.em_cpu_energyasbuh1hhj ubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj ubj )}(hj h]h*}(hj hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj ubjr)}(hpdh]hpd}(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj ubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hj ubj{ )}(hunsigned long max_utilh](j= )}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj= )}(hlongh]hlong}(hj#hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hj1hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubjr)}(hmax_utilh]hmax_util}(hj?hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hj ubj{ )}(hunsigned long sum_utilh](j= )}(hunsignedh]hunsigned}(hjXhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjTubj[)}(h h]h }(hjfhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjTubj= )}(hlongh]hlong}(hjthhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjTubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjTubjr)}(hsum_utilh]hsum_util}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjTubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hj ubj{ )}(hunsigned long allowed_cpu_caph](j= )}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj= )}(hlongh]hlong}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubjr)}(hallowed_cpu_caph]hallowed_cpu_cap}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hj ubeh}(h]h ]h"]h$]h&]hhuh1jt hj8 hhhjJ hKubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhj4 hhhjJ hKubah}(h]j/ ah ](jjeh"]h$]h&]jj)jhuh1j<hjJ hKhj1 hhubj)}(hhh]h)}(hAEstimates the energy consumed by the CPUs of a performance domainh]hAEstimates the energy consumed by the CPUs of a performance domain}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjhhubah}(h]h ]h"]h$]h&]uh1jhj1 hhhjJ hKubeh}(h]h ](jfunctioneh"]h$]h&]jjjj#jj#jjjuh1j7hhhjhNhNubj)}(hX**Parameters** ``struct em_perf_domain *pd`` performance domain for which energy has to be estimated ``unsigned long max_util`` highest utilization among CPUs of the domain ``unsigned long sum_util`` sum of the utilization of all CPUs in the domain ``unsigned long allowed_cpu_cap`` maximum allowed CPU capacity for the **pd**, which might reflect reduced frequency (due to thermal) **Description** This function must be used only for CPU devices. There is no validation, i.e. if the EM is a CPU type and has cpumask allocated. It is called from the scheduler code quite frequently and that is why there is not checks. **Return** the sum of the energy consumed by the CPUs of the domain assuming a capacity state satisfying the max utilization of the domain.h](h)}(h**Parameters**h]j)}(hj-h]h Parameters}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj+ubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj'ubj)}(hhh](j)}(hV``struct em_perf_domain *pd`` performance domain for which energy has to be estimated h](j)}(h``struct em_perf_domain *pd``h]j)}(hjLh]hstruct em_perf_domain *pd}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjJubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjFubj7)}(hhh]h)}(h7performance domain for which energy has to be estimatedh]h7performance domain for which energy has to be estimated}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahKhjbubah}(h]h ]h"]h$]h&]uh1j6hjFubeh}(h]h ]h"]h$]h&]uh1jhjahKhjCubj)}(hH``unsigned long max_util`` highest utilization among CPUs of the domain h](j)}(h``unsigned long max_util``h]j)}(hjh]hunsigned long max_util}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj7)}(hhh]h)}(h,highest utilization among CPUs of the domainh]h,highest utilization among CPUs of the domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjCubj)}(hL``unsigned long sum_util`` sum of the utilization of all CPUs in the domain h](j)}(h``unsigned long sum_util``h]j)}(hjh]hunsigned long sum_util}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj7)}(hhh]h)}(h0sum of the utilization of all CPUs in the domainh]h0sum of the utilization of all CPUs in the domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhKhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhKhjCubj)}(h``unsigned long allowed_cpu_cap`` maximum allowed CPU capacity for the **pd**, which might reflect reduced frequency (due to thermal) h](j)}(h!``unsigned long allowed_cpu_cap``h]j)}(hjh]hunsigned long allowed_cpu_cap}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhjubj7)}(hhh]h)}(hcmaximum allowed CPU capacity for the **pd**, which might reflect reduced frequency (due to thermal)h](h%maximum allowed CPU capacity for the }(hjhhhNhNubj)}(h**pd**h]hpd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh8, which might reflect reduced frequency (due to thermal)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj ubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhj hKhjCubeh}(h]h ]h"]h$]h&]uh1jhj'ubh)}(h**Description**h]j)}(hjEh]h Description}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjCubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj'ubh)}(hThis function must be used only for CPU devices. There is no validation, i.e. if the EM is a CPU type and has cpumask allocated. It is called from the scheduler code quite frequently and that is why there is not checks.h]hThis function must be used only for CPU devices. There is no validation, i.e. if the EM is a CPU type and has cpumask allocated. It is called from the scheduler code quite frequently and that is why there is not checks.}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj'ubh)}(h **Return**h]j)}(hjlh]hReturn}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj'ubh)}(hthe sum of the energy consumed by the CPUs of the domain assuming a capacity state satisfying the max utilization of the domain.h]hthe sum of the energy consumed by the CPUs of the domain assuming a capacity state satisfying the max utilization of the domain.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhKhj'ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3!em_pd_nr_perf_states (C function)c.em_pd_nr_perf_stateshNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(h4int em_pd_nr_perf_states (struct em_perf_domain *pd)h]jC)}(h3int em_pd_nr_perf_states(struct em_perf_domain *pd)h](j= )}(hinth]hint}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjhhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM=ubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjhhhjhM=ubjl)}(hem_pd_nr_perf_statesh]jr)}(hem_pd_nr_perf_statesh]hem_pd_nr_perf_states}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ](jjeh"]h$]h&]hhuh1jkhjhhhjhM=ubju )}(h(struct em_perf_domain *pd)h]j{ )}(hstruct em_perf_domain *pdh](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubh)}(hhh]jr)}(hem_perf_domainh]hem_perf_domain}(hj hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]j )}j jsbc.em_pd_nr_perf_statesasbuh1hhjubj[)}(h h]h }(hj,hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj )}(hj h]h*}(hj:hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjr)}(hpdh]hpd}(hjGhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubah}(h]h ]h"]h$]h&]hhuh1jt hjhhhjhM=ubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjhhhjhM=ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j<hjhM=hjhhubj)}(hhh]h)}(h6Get the number of performance states of a perf. domainh]h6Get the number of performance states of a perf. domain}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM7hjnhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM=ubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1j7hhhjhNhNubj)}(h**Parameters** ``struct em_perf_domain *pd`` performance domain for which this must be done **Return** the number of performance states in the performance domain tableh](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM;hjubj)}(hhh]j)}(hM``struct em_perf_domain *pd`` performance domain for which this must be done h](j)}(h``struct em_perf_domain *pd``h]j)}(hjh]hstruct em_perf_domain *pd}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM9hjubj7)}(hhh]h)}(h.performance domain for which this must be doneh]h.performance domain for which this must be done}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM9hjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhM9hjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h **Return**h]j)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM;hjubh)}(h@the number of performance states in the performance domain tableh]h@the number of performance states in the performance domain table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhM;hjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3"em_perf_state_from_pd (C function)c.em_perf_state_from_pdhNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(hHstruct em_perf_state * em_perf_state_from_pd (struct em_perf_domain *pd)h]jC)}(hFstruct em_perf_state *em_perf_state_from_pd(struct em_perf_domain *pd)h](jI)}(hjLh]hstruct}(hj2hhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhj.hhh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMMubj[)}(h h]h }(hj@hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj.hhhj?hMMubh)}(hhh]jr)}(h em_perf_stateh]h em_perf_state}(hjQhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjNubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjSmodnameN classnameNj j )}j ]j )}j em_perf_state_from_pdsbc.em_perf_state_from_pdasbuh1hhj.hhhj?hMMubj[)}(h h]h }(hjrhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj.hhhj?hMMubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj.hhhj?hMMubjl)}(hem_perf_state_from_pdh]jr)}(hjoh]hem_perf_state_from_pd}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ](jjeh"]h$]h&]hhuh1jkhj.hhhj?hMMubju )}(h(struct em_perf_domain *pd)h]j{ )}(hstruct em_perf_domain *pdh](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubh)}(hhh]jr)}(hem_perf_domainh]hem_perf_domain}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]jmc.em_perf_state_from_pdasbuh1hhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjr)}(hpdh]hpd}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubah}(h]h ]h"]h$]h&]hhuh1jt hj.hhhj?hMMubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhj*hhhj?hMMubah}(h]j%ah ](jjeh"]h$]h&]jj)jhuh1j<hj?hMMhj'hhubj)}(hhh]h)}(h0Get the performance states table of perf. domainh]h0Get the performance states table of perf. domain}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMChj*hhubah}(h]h ]h"]h$]h&]uh1jhj'hhhj?hMMubeh}(h]h ](jfunctioneh"]h$]h&]jjjjEjjEjjjuh1j7hhhjhNhNubj)}(hX]**Parameters** ``struct em_perf_domain *pd`` performance domain for which this must be done **Description** To use this function the rcu_read_lock() should be hold. After the usage of the performance states table is finished, the rcu_read_unlock() should be called. **Return** the pointer to performance states table of the performance domainh](h)}(h**Parameters**h]j)}(hjOh]h Parameters}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjMubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMGhjIubj)}(hhh]j)}(hM``struct em_perf_domain *pd`` performance domain for which this must be done h](j)}(h``struct em_perf_domain *pd``h]j)}(hjnh]hstruct em_perf_domain *pd}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1jhjlubah}(h]h ]h"]h$]h&]uh1jh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMEhjhubj7)}(hhh]h)}(h.performance domain for which this must be doneh]h.performance domain for which this must be done}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMEhjubah}(h]h ]h"]h$]h&]uh1j6hjhubeh}(h]h ]h"]h$]h&]uh1jhjhMEhjeubah}(h]h ]h"]h$]h&]uh1jhjIubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMGhjIubh)}(hTo use this function the rcu_read_lock() should be hold. After the usage of the performance states table is finished, the rcu_read_unlock() should be called.h]hTo use this function the rcu_read_lock() should be hold. After the usage of the performance states table is finished, the rcu_read_unlock() should be called.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMGhjIubh)}(h **Return**h]j)}(hjh]hReturn}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMKhjIubh)}(hAthe pointer to performance states table of the performance domainh]hAthe pointer to performance states table of the performance domain}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh`/var/lib/git/docbuild/linux/Documentation/power/energy-model:280: ./include/linux/energy_model.hhMKhjIubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3&em_dev_update_perf_domain (C function)c.em_dev_update_perf_domainhNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(hSint em_dev_update_perf_domain (struct device *dev, struct em_perf_table *new_table)h]jC)}(hRint em_dev_update_perf_domain(struct device *dev, struct em_perf_table *new_table)h](j= )}(hinth]hint}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM*ubj[)}(h h]h }(hj$hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjhhhj#hM*ubjl)}(hem_dev_update_perf_domainh]jr)}(hem_dev_update_perf_domainh]hem_dev_update_perf_domain}(hj6hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj2ubah}(h]h ](jjeh"]h$]h&]hhuh1jkhjhhhj#hM*ubju )}(h5(struct device *dev, struct em_perf_table *new_table)h](j{ )}(hstruct device *devh](jI)}(hjLh]hstruct}(hjRhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjNubj[)}(h h]h }(hj_hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjNubh)}(hhh]jr)}(hdeviceh]hdevice}(hjphhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjmubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjrmodnameN classnameNj j )}j ]j )}j j8sbc.em_dev_update_perf_domainasbuh1hhjNubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjNubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjNubjr)}(hdevh]hdev}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjNubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjJubj{ )}(hstruct em_perf_table *new_tableh](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubh)}(hhh]jr)}(h em_perf_tableh]h em_perf_table}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]jc.em_dev_update_perf_domainasbuh1hhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjr)}(h new_tableh]h new_table}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjJubeh}(h]h ]h"]h$]h&]hhuh1jt hjhhhj#hM*ubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhj hhhj#hM*ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j<hj#hM*hj hhubj)}(hhh]h)}(h$Update runtime EM table for a deviceh]h$Update runtime EM table for a device}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjBhhubah}(h]h ]h"]h$]h&]uh1jhj hhhj#hM*ubeh}(h]h ](jfunctioneh"]h$]h&]jjjj]jj]jjjuh1j7hhhjhNhNubj)}(hX**Parameters** ``struct device *dev`` Device for which the EM is to be updated ``struct em_perf_table *new_table`` The new EM table that is going to be used from now **Description** Update EM runtime modifiable table for the **dev** using the provided **table**. This function uses a mutex to serialize writers, so it must not be called from a non-sleeping context. Return 0 on success or an error code on failure.h](h)}(h**Parameters**h]j)}(hjgh]h Parameters}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1jhjeubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM#hjaubj)}(hhh](j)}(h@``struct device *dev`` Device for which the EM is to be updated h](j)}(h``struct device *dev``h]j)}(hjh]hstruct device *dev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM hjubj7)}(hhh]h)}(h(Device for which the EM is to be updatedh]h(Device for which the EM is to be updated}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM hjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhM hj}ubj)}(hW``struct em_perf_table *new_table`` The new EM table that is going to be used from now h](j)}(h#``struct em_perf_table *new_table``h]j)}(hjh]hstruct em_perf_table *new_table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM!hjubj7)}(hhh]h)}(h2The new EM table that is going to be used from nowh]h2The new EM table that is going to be used from now}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhM!hjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhM!hj}ubeh}(h]h ]h"]h$]h&]uh1jhjaubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM#hjaubh)}(hPUpdate EM runtime modifiable table for the **dev** using the provided **table**.h](h+Update EM runtime modifiable table for the }(hjhhhNhNubj)}(h**dev**h]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh using the provided }(hjhhhNhNubj)}(h **table**h]htable}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM#hjaubh)}(hfThis function uses a mutex to serialize writers, so it must not be called from a non-sleeping context.h]hfThis function uses a mutex to serialize writers, so it must not be called from a non-sleeping context.}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM%hjaubh)}(h0Return 0 on success or an error code on failure.h]h0Return 0 on success or an error code on failure.}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM(hjaubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3em_pd_get (C function) c.em_pd_gethNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(h6struct em_perf_domain * em_pd_get (struct device *dev)h]jC)}(h4struct em_perf_domain *em_pd_get(struct device *dev)h](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhj}hhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj}hhhjhMubh)}(hhh]jr)}(hem_perf_domainh]hem_perf_domain}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]j )}j em_pd_getsb c.em_pd_getasbuh1hhj}hhhjhMubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj}hhhjhMubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hj}hhhjhMubjl)}(h em_pd_geth]jr)}(hjh]h em_pd_get}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ](jjeh"]h$]h&]hhuh1jkhj}hhhjhMubju )}(h(struct device *dev)h]j{ )}(hstruct device *devh](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubh)}(hhh]jr)}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]j c.em_pd_getasbuh1hhjubj[)}(h h]h }(hj7hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj )}(hj h]h*}(hjEhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjr)}(hdevh]hdev}(hjRhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubah}(h]h ]h"]h$]h&]hhuh1jt hj}hhhjhMubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjyhhhjhMubah}(h]jtah ](jjeh"]h$]h&]jj)jhuh1j<hjhMhjvhhubj)}(hhh]h)}(h*Return the performance domain for a deviceh]h*Return the performance domain for a device}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjyhhubah}(h]h ]h"]h$]h&]uh1jhjvhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1j7hhhjhNhNubj)}(h**Parameters** ``struct device *dev`` Device to find the performance domain for **Description** Returns the performance domain to which **dev** belongs, or NULL if it doesn't exist.h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubj)}(hhh]j)}(hA``struct device *dev`` Device to find the performance domain for h](j)}(h``struct device *dev``h]j)}(hjh]hstruct device *dev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubj7)}(hhh]h)}(h)Device to find the performance domain forh]h)Device to find the performance domain for}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhMhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubh)}(hUReturns the performance domain to which **dev** belongs, or NULL if it doesn't exist.h](h(Returns the performance domain to which }(hjhhhNhNubj)}(h**dev**h]hdev}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh( belongs, or NULL if it doesn’t exist.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3em_cpu_get (C function) c.em_cpu_gethNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(h,struct em_perf_domain * em_cpu_get (int cpu)h]jC)}(h*struct em_perf_domain *em_cpu_get(int cpu)h](jI)}(hjLh]hstruct}(hjOhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjKhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMubj[)}(h h]h }(hj]hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjKhhhj\hMubh)}(hhh]jr)}(hem_perf_domainh]hem_perf_domain}(hjnhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjkubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjpmodnameN classnameNj j )}j ]j )}j em_cpu_getsb c.em_cpu_getasbuh1hhjKhhhj\hMubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjKhhhj\hMubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjKhhhj\hMubjl)}(h em_cpu_geth]jr)}(hjh]h em_cpu_get}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ](jjeh"]h$]h&]hhuh1jkhjKhhhj\hMubju )}(h (int cpu)h]j{ )}(hint cpuh](j= )}(hinth]hint}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubjr)}(hcpuh]hcpu}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubah}(h]h ]h"]h$]h&]hhuh1jt hjKhhhj\hMubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjGhhhj\hMubah}(h]jBah ](jjeh"]h$]h&]jj)jhuh1j<hj\hMhjDhhubj)}(hhh]h)}(h'Return the performance domain for a CPUh]h'Return the performance domain for a CPU}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj hhubah}(h]h ]h"]h$]h&]uh1jhjDhhhj\hMubeh}(h]h ](jfunctioneh"]h$]h&]jjjj'jj'jjjuh1j7hhhjhNhNubj)}(h**Parameters** ``int cpu`` CPU to find the performance domain for **Description** Returns the performance domain to which **cpu** belongs, or NULL if it doesn't exist.h](h)}(h**Parameters**h]j)}(hj1h]h Parameters}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj/ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj+ubj)}(hhh]j)}(h3``int cpu`` CPU to find the performance domain for h](j)}(h ``int cpu``h]j)}(hjPh]hint cpu}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjNubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjJubj7)}(hhh]h)}(h&CPU to find the performance domain forh]h&CPU to find the performance domain for}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjehMhjfubah}(h]h ]h"]h$]h&]uh1j6hjJubeh}(h]h ]h"]h$]h&]uh1jhjehMhjGubah}(h]h ]h"]h$]h&]uh1jhj+ubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj+ubh)}(hUReturns the performance domain to which **cpu** belongs, or NULL if it doesn't exist.h](h(Returns the performance domain to which }(hjhhhNhNubj)}(h**cpu**h]hcpu}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh( belongs, or NULL if it doesn’t exist.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj+ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3(em_dev_register_perf_domain (C function)c.em_dev_register_perf_domainhNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(hint em_dev_register_perf_domain (struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h]jC)}(hint em_dev_register_perf_domain(struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h](j= )}(hinth]hint}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM$ubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjhhhjhM$ubjl)}(hem_dev_register_perf_domainh]jr)}(hem_dev_register_perf_domainh]hem_dev_register_perf_domain}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ](jjeh"]h$]h&]hhuh1jkhjhhhjhM$ubju )}(hw(struct device *dev, unsigned int nr_states, const struct em_data_callback *cb, const cpumask_t *cpus, bool microwatts)h](j{ )}(hstruct device *devh](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hj,hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubh)}(hhh]jr)}(hdeviceh]hdevice}(hj=hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj:ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj?modnameN classnameNj j )}j ]j )}j jsbc.em_dev_register_perf_domainasbuh1hhjubj[)}(h h]h }(hj]hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj )}(hj h]h*}(hjkhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjr)}(hdevh]hdev}(hjxhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubj{ )}(hunsigned int nr_statesh](j= )}(hunsignedh]hunsigned}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj= )}(hinth]hint}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubjr)}(h nr_statesh]h nr_states}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubj{ )}(h!const struct em_data_callback *cbh](jI)}(hconsth]hconst}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubjI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubh)}(hhh]jr)}(hem_data_callbackh]hem_data_callback}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]jYc.em_dev_register_perf_domainasbuh1hhjubj[)}(h h]h }(hj:hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj )}(hj h]h*}(hjHhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjr)}(hcbh]hcb}(hjUhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubj{ )}(hconst cpumask_t *cpush](jI)}(hjh]hconst}(hjnhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjjubj[)}(h h]h }(hj{hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjjubh)}(hhh]jr)}(h cpumask_th]h cpumask_t}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]jYc.em_dev_register_perf_domainasbuh1hhjjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjjubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjjubjr)}(hcpush]hcpus}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubj{ )}(hbool microwattsh](j= )}(hboolh]hbool}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubjr)}(h microwattsh]h microwatts}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubeh}(h]h ]h"]h$]h&]hhuh1jt hjhhhjhM$ubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjhhhjhM$ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j<hjhM$hjhhubj)}(hhh]h)}(h+Register the Energy Model (EM) for a deviceh]h+Register the Energy Model (EM) for a device}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj!hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM$ubeh}(h]h ](jfunctioneh"]h$]h&]jjjj<jj<jjjuh1j7hhhjhNhNubj)}(hX**Parameters** ``struct device *dev`` Device for which the EM is to register ``unsigned int nr_states`` Number of performance states to register ``const struct em_data_callback *cb`` Callback functions providing the data of the Energy Model ``const cpumask_t *cpus`` Pointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. 'policy->cpus'. For other type of devices this should be set to NULL. ``bool microwatts`` Flag indicating that the power values are in micro-Watts or in some other scale. It must be set properly. **Description** Create Energy Model tables for a performance domain using the callbacks defined in cb. The **microwatts** is important to set with correct value. Some kernel sub-systems might rely on this flag and check if all devices in the EM are using the same scale. If multiple clients register the same performance domain, all but the first registration will be ignored. Return 0 on successh](h)}(h**Parameters**h]j)}(hjFh]h Parameters}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj@ubj)}(hhh](j)}(h>``struct device *dev`` Device for which the EM is to register h](j)}(h``struct device *dev``h]j)}(hjeh]hstruct device *dev}(hjghhhNhNubah}(h]h ]h"]h$]h&]uh1jhjcubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj_ubj7)}(hhh]h)}(h&Device for which the EM is to registerh]h&Device for which the EM is to register}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjzhMhj{ubah}(h]h ]h"]h$]h&]uh1j6hj_ubeh}(h]h ]h"]h$]h&]uh1jhjzhMhj\ubj)}(hD``unsigned int nr_states`` Number of performance states to register h](j)}(h``unsigned int nr_states``h]j)}(hjh]hunsigned int nr_states}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubj7)}(hhh]h)}(h(Number of performance states to registerh]h(Number of performance states to register}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhMhj\ubj)}(h```const struct em_data_callback *cb`` Callback functions providing the data of the Energy Model h](j)}(h%``const struct em_data_callback *cb``h]j)}(hjh]h!const struct em_data_callback *cb}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubj7)}(hhh]h)}(h9Callback functions providing the data of the Energy Modelh]h9Callback functions providing the data of the Energy Model}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhMhjubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhjhMhj\ubj)}(h``const cpumask_t *cpus`` Pointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. 'policy->cpus'. For other type of devices this should be set to NULL. h](j)}(h``const cpumask_t *cpus``h]j)}(hjh]hconst cpumask_t *cpus}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj ubj7)}(hhh]h)}(hPointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. 'policy->cpus'. For other type of devices this should be set to NULL.h]hPointer to cpumask_t, which in case of a CPU device is obligatory. It can be taken from i.e. ‘policy->cpus’. For other type of devices this should be set to NULL.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj&ubah}(h]h ]h"]h$]h&]uh1j6hj ubeh}(h]h ]h"]h$]h&]uh1jhj%hMhj\ubj)}(h~``bool microwatts`` Flag indicating that the power values are in micro-Watts or in some other scale. It must be set properly. h](j)}(h``bool microwatts``h]j)}(hjJh]hbool microwatts}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjHubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjDubj7)}(hhh]h)}(hiFlag indicating that the power values are in micro-Watts or in some other scale. It must be set properly.h]hiFlag indicating that the power values are in micro-Watts or in some other scale. It must be set properly.}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj`ubah}(h]h ]h"]h$]h&]uh1j6hjDubeh}(h]h ]h"]h$]h&]uh1jhj_hMhj\ubeh}(h]h ]h"]h$]h&]uh1jhj@ubh)}(h**Description**h]j)}(hjh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj@ubh)}(hVCreate Energy Model tables for a performance domain using the callbacks defined in cb.h]hVCreate Energy Model tables for a performance domain using the callbacks defined in cb.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj@ubh)}(hThe **microwatts** is important to set with correct value. Some kernel sub-systems might rely on this flag and check if all devices in the EM are using the same scale.h](hThe }(hjhhhNhNubj)}(h**microwatts**h]h microwatts}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh is important to set with correct value. Some kernel sub-systems might rely on this flag and check if all devices in the EM are using the same scale.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj@ubh)}(hiIf multiple clients register the same performance domain, all but the first registration will be ignored.h]hiIf multiple clients register the same performance domain, all but the first registration will be ignored.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhj@ubh)}(hReturn 0 on successh]hReturn 0 on success}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM"hj@ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3*em_dev_unregister_perf_domain (C function)c.em_dev_unregister_perf_domainhNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(h7void em_dev_unregister_perf_domain (struct device *dev)h]jC)}(h6void em_dev_unregister_perf_domain(struct device *dev)h](j= )}(hvoidh]hvoid}(hj hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjhhhjhMubjl)}(hem_dev_unregister_perf_domainh]jr)}(hem_dev_unregister_perf_domainh]hem_dev_unregister_perf_domain}(hj+hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj'ubah}(h]h ](jjeh"]h$]h&]hhuh1jkhjhhhjhMubju )}(h(struct device *dev)h]j{ )}(hstruct device *devh](jI)}(hjLh]hstruct}(hjGhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjCubj[)}(h h]h }(hjThhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjCubh)}(hhh]jr)}(hdeviceh]hdevice}(hjehhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjbubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjgmodnameN classnameNj j )}j ]j )}j j-sbc.em_dev_unregister_perf_domainasbuh1hhjCubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjCubj )}(hj h]h*}(hjhhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjCubjr)}(hdevh]hdev}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjCubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hj?ubah}(h]h ]h"]h$]h&]hhuh1jt hjhhhjhMubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjhhhjhMubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j<hjhMhjhhubj)}(hhh]h)}(h)Unregister Energy Model (EM) for a deviceh]h)Unregister Energy Model (EM) for a device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjhhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhMubeh}(h]h ](jfunctioneh"]h$]h&]jjjjjjjjjuh1j7hhhjhNhNubj)}(h**Parameters** ``struct device *dev`` Device for which the EM is registered **Description** Unregister the EM for the specified **dev** (but not a CPU device).h](h)}(h**Parameters**h]j)}(hjh]h Parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubj)}(hhh]j)}(h=``struct device *dev`` Device for which the EM is registered h](j)}(h``struct device *dev``h]j)}(hj h]hstruct device *dev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubj7)}(hhh]h)}(h%Device for which the EM is registeredh]h%Device for which the EM is registered}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hMhj!ubah}(h]h ]h"]h$]h&]uh1j6hjubeh}(h]h ]h"]h$]h&]uh1jhj hMhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h**Description**h]j)}(hjFh]h Description}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjDubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubh)}(hCUnregister the EM for the specified **dev** (but not a CPU device).h](h$Unregister the EM for the specified }(hj\hhhNhNubj)}(h**dev**h]hdev}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj\ubh (but not a CPU device).}(hj\hhhNhNubeh}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMhjubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3'em_dev_update_chip_binning (C function)c.em_dev_update_chip_binninghNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(h3int em_dev_update_chip_binning (struct device *dev)h]jC)}(h2int em_dev_update_chip_binning(struct device *dev)h](j= )}(hinth]hint}(hjhhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hjhhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM0ubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjhhhjhM0ubjl)}(hem_dev_update_chip_binningh]jr)}(hem_dev_update_chip_binningh]hem_dev_update_chip_binning}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ](jjeh"]h$]h&]hhuh1jkhjhhhjhM0ubju )}(h(struct device *dev)h]j{ )}(hstruct device *devh](jI)}(hjLh]hstruct}(hjhhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjubj[)}(h h]h }(hjhhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubh)}(hhh]jr)}(hdeviceh]hdevice}(hjhhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetjmodnameN classnameNj j )}j ]j )}j jsbc.em_dev_update_chip_binningasbuh1hhjubj[)}(h h]h }(hj hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjubj )}(hj h]h*}(hj& hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjubjr)}(hdevh]hdev}(hj3 hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjubah}(h]h ]h"]h$]h&]hhuh1jt hjhhhjhM0ubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhjhhhjhM0ubah}(h]jah ](jjeh"]h$]h&]jj)jhuh1j<hjhM0hjhhubj)}(hhh]h)}(hMUpdate Energy Model after the new voltage information is present in the OPPs.h]hMUpdate Energy Model after the new voltage information is present in the OPPs.}(hj] hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM(hjZ hhubah}(h]h ]h"]h$]h&]uh1jhjhhhjhM0ubeh}(h]h ](jfunctioneh"]h$]h&]jjjju jju jjjuh1j7hhhjhNhNubj)}(hXP**Parameters** ``struct device *dev`` Device for which the Energy Model has to be updated. **Description** This function allows to update easily the EM with new values available in the OPP framework and DT. It can be used after the chip has been properly verified by device drivers and the voltages adjusted for the 'chip binning'.h](h)}(h**Parameters**h]j)}(hj h]h Parameters}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj} ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM,hjy ubj)}(hhh]j)}(hL``struct device *dev`` Device for which the Energy Model has to be updated. h](j)}(h``struct device *dev``h]j)}(hj h]hstruct device *dev}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM*hj ubj7)}(hhh]h)}(h4Device for which the Energy Model has to be updated.h]h4Device for which the Energy Model has to be updated.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hM*hj ubah}(h]h ]h"]h$]h&]uh1j6hj ubeh}(h]h ]h"]h$]h&]uh1jhj hM*hj ubah}(h]h ]h"]h$]h&]uh1jhjy ubh)}(h**Description**h]j)}(hj h]h Description}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM,hjy ubh)}(hThis function allows to update easily the EM with new values available in the OPP framework and DT. It can be used after the chip has been properly verified by device drivers and the voltages adjusted for the 'chip binning'.h]hThis function allows to update easily the EM with new values available in the OPP framework and DT. It can be used after the chip has been properly verified by device drivers and the voltages adjusted for the ‘chip binning’.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM,hjy ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubj')}(hhh]h}(h]h ]h"]h$]h&]entries](j3)em_update_performance_limits (C function)c.em_update_performance_limitshNtauh1j&hjhhhNhNubj8)}(hhh](j=)}(htint em_update_performance_limits (struct em_perf_domain *pd, unsigned long freq_min_khz, unsigned long freq_max_khz)h]jC)}(hsint em_update_performance_limits(struct em_perf_domain *pd, unsigned long freq_min_khz, unsigned long freq_max_khz)h](j= )}(hinth]hint}(hj!hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hj!hhh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMdubj[)}(h h]h }(hj-!hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj!hhhj,!hMdubjl)}(hem_update_performance_limitsh]jr)}(hem_update_performance_limitsh]hem_update_performance_limits}(hj?!hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj;!ubah}(h]h ](jjeh"]h$]h&]hhuh1jkhj!hhhj,!hMdubju )}(hS(struct em_perf_domain *pd, unsigned long freq_min_khz, unsigned long freq_max_khz)h](j{ )}(hstruct em_perf_domain *pdh](jI)}(hjLh]hstruct}(hj[!hhhNhNubah}(h]h ]jUah"]h$]h&]uh1jHhjW!ubj[)}(h h]h }(hjh!hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjW!ubh)}(hhh]jr)}(hem_perf_domainh]hem_perf_domain}(hjy!hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjv!ubah}(h]h ]h"]h$]h&] refdomainjreftypej reftargetj{!modnameN classnameNj j )}j ]j )}j jA!sbc.em_update_performance_limitsasbuh1hhjW!ubj[)}(h h]h }(hj!hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhjW!ubj )}(hj h]h*}(hj!hhhNhNubah}(h]h ]j ah"]h$]h&]uh1j hjW!ubjr)}(hpdh]hpd}(hj!hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhjW!ubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjS!ubj{ )}(hunsigned long freq_min_khzh](j= )}(hunsignedh]hunsigned}(hj!hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hj!ubj[)}(h h]h }(hj!hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj!ubj= )}(hlongh]hlong}(hj!hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hj!ubj[)}(h h]h }(hj!hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj!ubjr)}(h freq_min_khzh]h freq_min_khz}(hj"hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj!ubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjS!ubj{ )}(hunsigned long freq_max_khzh](j= ;G)}(hunsignedh]hunsigned}(hj"hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hj"ubj[)}(h h]h }(hj,"hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj"ubj= )}(hlongh]hlong}(hj:"hhhNhNubah}(h]h ]jI ah"]h$]h&]uh1j< hj"ubj[)}(h h]h }(hjH"hhhNhNubah}(h]h ]jgah"]h$]h&]uh1jZhj"ubjr)}(h freq_max_khzh]h freq_max_khz}(hjV"hhhNhNubah}(h]h ]j}ah"]h$]h&]uh1jqhj"ubeh}(h]h ]h"]h$]h&]noemphhhuh1jz hjS!ubeh}(h]h ]h"]h$]h&]hhuh1jt hj!hhhj,!hMdubeh}(h]h ]h"]h$]h&]hhjuh1jBjjhj!hhhj,!hMdubah}(h]j!ah ](jjeh"]h$]h&]jj)jhuh1j<hj,!hMdhj!hhubj)}(hhh]h)}(h8Update Energy Model with performance limits information.h]h8Update Energy Model with performance limits information.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chMYhj}"hhubah}(h]h ]h"]h$]h&]uh1jhj!hhhj,!hMdubeh}(h]h ](jfunctioneh"]h$]h&]jjjj"jj"jjjuh1j7hhhjhNhNubj)}(hX**Parameters** ``struct em_perf_domain *pd`` Performance Domain with EM that has to be updated. ``unsigned long freq_min_khz`` New minimum allowed frequency for this device. ``unsigned long freq_max_khz`` New maximum allowed frequency for this device. **Description** This function allows to update the EM with information about available performance levels. It takes the minimum and maximum frequency in kHz and does internal translation to performance levels. Returns 0 on success or -EINVAL when failed.h](h)}(h**Parameters**h]j)}(hj"h]h Parameters}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM]hj"ubj)}(hhh](j)}(hQ``struct em_perf_domain *pd`` Performance Domain with EM that has to be updated. h](j)}(h``struct em_perf_domain *pd``h]j)}(hj"h]hstruct em_perf_domain *pd}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM[hj"ubj7)}(hhh]h)}(h2Performance Domain with EM that has to be updated.h]h2Performance Domain with EM that has to be updated.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"hM[hj"ubah}(h]h ]h"]h$]h&]uh1j6hj"ubeh}(h]h ]h"]h$]h&]uh1jhj"hM[hj"ubj)}(hN``unsigned long freq_min_khz`` New minimum allowed frequency for this device. h](j)}(h``unsigned long freq_min_khz``h]j)}(hj"h]hunsigned long freq_min_khz}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj"ubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM\hj"ubj7)}(hhh]h)}(h.New minimum allowed frequency for this device.h]h.New minimum allowed frequency for this device.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hM\hj#ubah}(h]h ]h"]h$]h&]uh1j6hj"ubeh}(h]h ]h"]h$]h&]uh1jhj#hM\hj"ubj)}(hN``unsigned long freq_max_khz`` New maximum allowed frequency for this device. h](j)}(h``unsigned long freq_max_khz``h]j)}(hj3#h]hunsigned long freq_max_khz}(hj5#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj1#ubah}(h]h ]h"]h$]h&]uh1jh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM]hj-#ubj7)}(hhh]h)}(h.New maximum allowed frequency for this device.h]h.New maximum allowed frequency for this device.}(hjL#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjH#hM]hjI#ubah}(h]h ]h"]h$]h&]uh1j6hj-#ubeh}(h]h ]h"]h$]h&]uh1jhjH#hM]hj"ubeh}(h]h ]h"]h$]h&]uh1jhj"ubh)}(h**Description**h]j)}(hjn#h]h Description}(hjp#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjl#ubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM_hj"ubh)}(hThis function allows to update the EM with information about available performance levels. It takes the minimum and maximum frequency in kHz and does internal translation to performance levels. Returns 0 on success or -EINVAL when failed.h]hThis function allows to update the EM with information about available performance levels. It takes the minimum and maximum frequency in kHz and does internal translation to performance levels. Returns 0 on success or -EINVAL when failed.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hh_/var/lib/git/docbuild/linux/Documentation/power/energy-model:283: ./kernel/power/energy_model.chM_hj"ubeh}(h]h ] kernelindentah"]h$]h&]uh1jhjhhhNhNubeh}(h]description-details-of-this-apiah ]h"]#2.5 description details of this apiah$]h&]uh1hhjrhhhhhMubeh}(h] core-apisah ]h"] 2. core apisah$]h&]uh1hhhhhhhhKeubh)}(hhh](h)}(h 3. Examplesh]h 3. Examples}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hhhhhM ubh)}(hhh](h)}(h'3.1 Example driver with EM registrationh]h'3.1 Example driver with EM registration}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hhhhhM#ubh)}(hXThe CPUFreq framework supports dedicated callback for registering the EM for a given CPU(s) 'policy' object: cpufreq_driver::register_em(). That callback has to be implemented properly for a given driver, because the framework would call it at the right time during setup. This section provides a simple example of a CPUFreq driver registering a performance domain in the Energy Model framework using the (fake) 'foo' protocol. The driver implements an est_power() function to be provided to the EM framework::h]hXThe CPUFreq framework supports dedicated callback for registering the EM for a given CPU(s) ‘policy’ object: cpufreq_driver::register_em(). That callback has to be implemented properly for a given driver, because the framework would call it at the right time during setup. This section provides a simple example of a CPUFreq driver registering a performance domain in the Energy Model framework using the (fake) ‘foo’ protocol. The driver implements an est_power() function to be provided to the EM framework:}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM%hj#hhubj)}(hX-> drivers/cpufreq/foo_cpufreq.c 01 static int est_power(struct device *dev, unsigned long *mW, 02 unsigned long *KHz) 03 { 04 long freq, power; 05 06 /* Use the 'foo' protocol to ceil the frequency */ 07 freq = foo_get_freq_ceil(dev, *KHz); 08 if (freq < 0); 09 return freq; 10 11 /* Estimate the power cost for the dev at the relevant freq. */ 12 power = foo_estimate_power(dev, freq); 13 if (power < 0); 14 return power; 15 16 /* Return the values to the EM framework */ 17 *mW = power; 18 *KHz = freq; 19 20 return 0; 21 } 22 23 static void foo_cpufreq_register_em(struct cpufreq_policy *policy) 24 { 25 struct em_data_callback em_cb = EM_DATA_CB(est_power); 26 struct device *cpu_dev; 27 int nr_opp; 28 29 cpu_dev = get_cpu_device(cpumask_first(policy->cpus)); 30 31 /* Find the number of OPPs for this policy */ 32 nr_opp = foo_get_nr_opp(policy); 33 34 /* And register the new performance domain */ 35 em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus, 36 true); 37 } 38 39 static struct cpufreq_driver foo_cpufreq_driver = { 40 .register_em = foo_cpufreq_register_em, 41 };h]hX-> drivers/cpufreq/foo_cpufreq.c 01 static int est_power(struct device *dev, unsigned long *mW, 02 unsigned long *KHz) 03 { 04 long freq, power; 05 06 /* Use the 'foo' protocol to ceil the frequency */ 07 freq = foo_get_freq_ceil(dev, *KHz); 08 if (freq < 0); 09 return freq; 10 11 /* Estimate the power cost for the dev at the relevant freq. */ 12 power = foo_estimate_power(dev, freq); 13 if (power < 0); 14 return power; 15 16 /* Return the values to the EM framework */ 17 *mW = power; 18 *KHz = freq; 19 20 return 0; 21 } 22 23 static void foo_cpufreq_register_em(struct cpufreq_policy *policy) 24 { 25 struct em_data_callback em_cb = EM_DATA_CB(est_power); 26 struct device *cpu_dev; 27 int nr_opp; 28 29 cpu_dev = get_cpu_device(cpumask_first(policy->cpus)); 30 31 /* Find the number of OPPs for this policy */ 32 nr_opp = foo_get_nr_opp(policy); 33 34 /* And register the new performance domain */ 35 em_dev_register_perf_domain(cpu_dev, nr_opp, &em_cb, policy->cpus, 36 true); 37 } 38 39 static struct cpufreq_driver foo_cpufreq_driver = { 40 .register_em = foo_cpufreq_register_em, 41 };}hj#sbah}(h]h ]h"]h$]h&]hhuh1jhhhM.hj#hhubeh}(h]#example-driver-with-em-registrationah ]h"]'3.1 example driver with em registrationah$]h&]uh1hhj#hhhhhM#ubh)}(hhh](h)}(h'3.2 Example driver with EM modificationh]h'3.2 Example driver with EM modification}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hhhhhM\ubh)}(hThis section provides a simple example of a thermal driver modifying the EM. The driver implements a foo_thermal_em_update() function. The driver is woken up periodically to check the temperature and modify the EM data::h]hThis section provides a simple example of a thermal driver modifying the EM. The driver implements a foo_thermal_em_update() function. The driver is woken up periodically to check the temperature and modify the EM data:}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM^hj#hhubj)}(hX-> drivers/soc/example/example_em_mod.c 01 static void foo_get_new_em(struct foo_context *ctx) 02 { 03 struct em_perf_table __rcu *em_table; 04 struct em_perf_state *table, *new_table; 05 struct device *dev = ctx->dev; 06 struct em_perf_domain *pd; 07 unsigned long freq; 08 int i, ret; 09 10 pd = em_pd_get(dev); 11 if (!pd) 12 return; 13 14 em_table = em_table_alloc(pd); 15 if (!em_table) 16 return; 17 18 new_table = em_table->state; 19 20 rcu_read_lock(); 21 table = em_perf_state_from_pd(pd); 22 for (i = 0; i < pd->nr_perf_states; i++) { 23 freq = table[i].frequency; 24 foo_get_power_perf_values(dev, freq, &new_table[i]); 25 } 26 rcu_read_unlock(); 27 28 /* Calculate 'cost' values for EAS */ 29 ret = em_dev_compute_costs(dev, table, pd->nr_perf_states); 30 if (ret) { 31 dev_warn(dev, "EM: compute costs failed %d\n", ret); 32 em_free_table(em_table); 33 return; 34 } 35 36 ret = em_dev_update_perf_domain(dev, em_table); 37 if (ret) { 38 dev_warn(dev, "EM: update failed %d\n", ret); 39 em_free_table(em_table); 40 return; 41 } 42 43 /* 44 * Since it's one-time-update drop the usage counter. 45 * The EM framework will later free the table when needed. 46 */ 47 em_table_free(em_table); 48 } 49 50 /* 51 * Function called periodically to check the temperature and 52 * update the EM if needed 53 */ 54 static void foo_thermal_em_update(struct foo_context *ctx) 55 { 56 struct device *dev = ctx->dev; 57 int cpu; 58 59 ctx->temperature = foo_get_temp(dev, ctx); 60 if (ctx->temperature < FOO_EM_UPDATE_TEMP_THRESHOLD) 61 return; 62 63 foo_get_new_em(ctx); 64 }h]hX-> drivers/soc/example/example_em_mod.c 01 static void foo_get_new_em(struct foo_context *ctx) 02 { 03 struct em_perf_table __rcu *em_table; 04 struct em_perf_state *table, *new_table; 05 struct device *dev = ctx->dev; 06 struct em_perf_domain *pd; 07 unsigned long freq; 08 int i, ret; 09 10 pd = em_pd_get(dev); 11 if (!pd) 12 return; 13 14 em_table = em_table_alloc(pd); 15 if (!em_table) 16 return; 17 18 new_table = em_table->state; 19 20 rcu_read_lock(); 21 table = em_perf_state_from_pd(pd); 22 for (i = 0; i < pd->nr_perf_states; i++) { 23 freq = table[i].frequency; 24 foo_get_power_perf_values(dev, freq, &new_table[i]); 25 } 26 rcu_read_unlock(); 27 28 /* Calculate 'cost' values for EAS */ 29 ret = em_dev_compute_costs(dev, table, pd->nr_perf_states); 30 if (ret) { 31 dev_warn(dev, "EM: compute costs failed %d\n", ret); 32 em_free_table(em_table); 33 return; 34 } 35 36 ret = em_dev_update_perf_domain(dev, em_table); 37 if (ret) { 38 dev_warn(dev, "EM: update failed %d\n", ret); 39 em_free_table(em_table); 40 return; 41 } 42 43 /* 44 * Since it's one-time-update drop the usage counter. 45 * The EM framework will later free the table when needed. 46 */ 47 em_table_free(em_table); 48 } 49 50 /* 51 * Function called periodically to check the temperature and 52 * update the EM if needed 53 */ 54 static void foo_thermal_em_update(struct foo_context *ctx) 55 { 56 struct device *dev = ctx->dev; 57 int cpu; 58 59 ctx->temperature = foo_get_temp(dev, ctx); 60 if (ctx->temperature < FOO_EM_UPDATE_TEMP_THRESHOLD) 61 return; 62 63 foo_get_new_em(ctx); 64 }}hj$sbah}(h]h ]h"]h$]h&]hhuh1jhhhMbhj#hhubeh}(h]#example-driver-with-em-modificationah ]h"]'3.2 example driver with em modificationah$]h&]uh1hhj#hhhhhM\ubeh}(h]examplesah ]h"] 3. examplesah$]h&]uh1hhhhhhhhM ubeh}(h]energy-model-of-devicesah ]h"]energy model of devicesah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjX$error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(j2$j/$jojlj#j#jjjjj jj0j-jWjTjjjjjjj#j#j*$j'$j#j#j"$j$u nametypes}(j2$joj#jjj j0jWjjjj#j*$j#j"$uh}(j/$hjlhj#jrjjjjjjj-j jTj3jjZjjjj j#jj5j>jUjZjjj/ j4 j/ j4 jjj%j*jj jtjyjBjGjjjjjjj!j!j'$j#j#j#j$j#u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.