diff options
| author | Patrick Bellasi <patrick.bellasi@arm.com> | 2016-07-29 15:45:57 +0100 |
|---|---|---|
| committer | John Stultz <john.stultz@linaro.org> | 2016-08-10 15:17:45 -0700 |
| commit | 6ba071d89dd72b080b9f0e4abf587cad99d5320b (patch) | |
| tree | 9ba5c8f11d9014a5c6a7dbc159dce3a98e3b9358 /kernel/sched/tune.c | |
| parent | 28e8cb961c2f71a89e391335a9304c3dd8b38d8f (diff) | |
FIX: sched/tune: move schedtune_nornalize_energy into fair.c
The energy normalization function is required to get the proper values
for the P-E space filtering function to work.
That normalization is part of the hot wakeup path and currently implemented
with a function call.
Moving the normalization function into fair.c allows the compiler to
further optimize that code by reducing overheads in the wakeup hot path.
Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
[jstultz: fwdported to 4.4]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/sched/tune.c')
| -rw-r--r-- | kernel/sched/tune.c | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/kernel/sched/tune.c b/kernel/sched/tune.c index b40d40dc3c49..8ca8db2de818 100644 --- a/kernel/sched/tune.c +++ b/kernel/sched/tune.c @@ -3,24 +3,17 @@ #include <linux/kernel.h> #include <linux/percpu.h> #include <linux/printk.h> -#include <linux/reciprocal_div.h> #include <linux/rcupdate.h> #include <linux/slab.h> #include <trace/events/sched.h> #include "sched.h" +#include "tune.h" unsigned int sysctl_sched_cfs_boost __read_mostly; -/* - * System energy normalization constants - */ -static struct target_nrg { - unsigned long min_power; - unsigned long max_power; - struct reciprocal_value rdiv; -} schedtune_target_nrg; +extern struct target_nrg schedtune_target_nrg; /* Performance Boost region (B) threshold params */ static int perf_boost_idx; @@ -587,37 +580,6 @@ sysctl_sched_cfs_boost_handler(struct ctl_table *table, int write, return 0; } -/* - * System energy normalization - * Returns the normalized value, in the range [0..SCHED_LOAD_SCALE], - * corresponding to the specified energy variation. - */ -int -schedtune_normalize_energy(int energy_diff) -{ - u32 normalized_nrg; - int max_delta; - -#ifdef CONFIG_SCHED_DEBUG - /* Check for boundaries */ - max_delta = schedtune_target_nrg.max_power; - max_delta -= schedtune_target_nrg.min_power; - WARN_ON(abs(energy_diff) >= max_delta); -#endif - - /* Do scaling using positive numbers to increase the range */ - normalized_nrg = (energy_diff < 0) ? -energy_diff : energy_diff; - - /* Scale by energy magnitude */ - normalized_nrg <<= SCHED_LOAD_SHIFT; - - /* Normalize on max energy for target platform */ - normalized_nrg = reciprocal_divide( - normalized_nrg, schedtune_target_nrg.rdiv); - - return (energy_diff < 0) ? -normalized_nrg : normalized_nrg; -} - #ifdef CONFIG_SCHED_DEBUG static void schedtune_test_nrg(unsigned long delta_pwr) |
