summaryrefslogtreecommitdiff
path: root/kernel/sched/tune.h
diff options
context:
space:
mode:
authorPatrick Bellasi <patrick.bellasi@arm.com>2016-01-12 18:12:13 +0000
committerAmit Pundir <amit.pundir@linaro.org>2016-09-14 14:58:22 +0530
commit641e534d8a189177f76e6d72a72009929840b04a (patch)
tree9bdf56198e03c32b8733ab55d6fc5a1dd19c4cdc /kernel/sched/tune.h
parent6b529bb329d8cc179524d4747ebb72b5a4b0353e (diff)
sched/tune: add support to compute normalized energy
The current EAS implementation considers only energy variations, while it disregards completely the impact on performance for the selection of a certain schedule candidate. Moreover, it also makes its decision based on the "absolute" value of expected energy variations. In order to properly define a trade-off strategy between increased energy consumption and performances benefits it is required to compare energy variations with performance variations. Thus, both performance and energy metrics must be expressed in comparable units. While the performance variations are expressed in terms of capacity deltas, which are defined in the range [0..SCHED_LOAD_SCALE], the same scale is not used for energy variations. This patch introduces the function: schedtune_normalize_energy(energy_diff) which returns a normalized value in the same range of capacity variations, i.e. [0..SCHED_LOAD_SCALE]. A proper set of energy normalization constants are required to provide a fast division by a constant during the normalziation of the energy_diff. The value of these constants depends on the specific energy model and topology of a target device. Thus, this patch provides also the required support for the computation at boot time of this set of variables. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
Diffstat (limited to 'kernel/sched/tune.h')
-rw-r--r--kernel/sched/tune.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/sched/tune.h b/kernel/sched/tune.h
index d756ce7b06e0..f7273a5d994a 100644
--- a/kernel/sched/tune.h
+++ b/kernel/sched/tune.h
@@ -16,9 +16,16 @@ void schedtune_dequeue_task(struct task_struct *p, int cpu);
#endif /* CONFIG_CGROUP_SCHEDTUNE */
+int schedtune_normalize_energy(int energy);
+int schedtune_accept_deltas(int nrg_delta, int cap_delta,
+ struct task_struct *task);
+
#else /* CONFIG_SCHED_TUNE */
#define schedtune_enqueue_task(task, cpu) do { } while (0)
#define schedtune_dequeue_task(task, cpu) do { } while (0)
+#define schedtune_normalize_energy(energy) energy
+#define schedtune_accept_deltas(nrg_delta, cap_delta, task) nrg_delta
+
#endif /* CONFIG_SCHED_TUNE */