aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/energy_model.h
diff options
context:
space:
mode:
authorPierre Gondois <Pierre.Gondois@arm.com>2022-03-21 09:57:23 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-04-13 16:26:17 +0200
commitfc3a9a9858478ab5f8441765a3f9552a0ceba10c (patch)
tree4a85b97562b6d43775f86b7d2892e403d091ce83 /include/linux/energy_model.h
parentPM: EM: Add .get_cost() callback (diff)
downloadwireguard-linux-fc3a9a9858478ab5f8441765a3f9552a0ceba10c.tar.xz
wireguard-linux-fc3a9a9858478ab5f8441765a3f9552a0ceba10c.zip
PM: EM: Add artificial EM flag
The Energy Model (EM) can be used on platforms which are missing real power information. Those platforms would implement .get_cost() which populates needed values for the Energy Aware Scheduler (EAS). The EAS doesn't use 'power' fields from EM, but other frameworks might use them. Thus, to avoid miss-usage of this specific type of EM, introduce a new flags which can be checked by other frameworks. Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/energy_model.h')
-rw-r--r--include/linux/energy_model.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
index 0a3a5663177b..92e82a322859 100644
--- a/include/linux/energy_model.h
+++ b/include/linux/energy_model.h
@@ -67,11 +67,16 @@ struct em_perf_domain {
*
* EM_PERF_DOMAIN_SKIP_INEFFICIENCIES: Skip inefficient states when estimating
* energy consumption.
+ *
+ * EM_PERF_DOMAIN_ARTIFICIAL: The power values are artificial and might be
+ * created by platform missing real power information
*/
#define EM_PERF_DOMAIN_MILLIWATTS BIT(0)
#define EM_PERF_DOMAIN_SKIP_INEFFICIENCIES BIT(1)
+#define EM_PERF_DOMAIN_ARTIFICIAL BIT(2)
#define em_span_cpus(em) (to_cpumask((em)->cpus))
+#define em_is_artificial(em) ((em)->flags & EM_PERF_DOMAIN_ARTIFICIAL)
#ifdef CONFIG_ENERGY_MODEL
#define EM_MAX_POWER 0xFFFF