summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Turquette <mturquette@linaro.org>2014-10-21 23:07:29 -0700
committerMichael Turquette <mturquette@deferred.io>2014-11-19 01:37:35 -0800
commit2a263bb3e627e1671f7eddbc131dcd08e6f381b5 (patch)
tree579d48269c96a1892dd53ffb4fe0d6c29285ec32
parent19679cf65ec9fda6d2d9b99d95ecb1be8e2c01ba (diff)
sched: cfs: cpu frequency scaling arch functions
arch_eval_cpu_freq and arch_scale_cpu_freq are added to allow the scheduler to evaluate if cpu frequency should change and to invoke that change from a safe context. They are weakly defined arch functions that do nothing by default. A CPUfreq governor could use these functions to implement a frequency scaling policy based on updates to per-task statistics or updates to per-cpu utilization. As discussed at Linux Plumbers Conference 2014, the goal will be to focus on a single cpu frequency scaling policy that works for everyone. That may mean that the weak arch functions definitions can be removed entirely and a single policy implements that logic for all architectures. Not-signed-off-by: Mike Turquette <mturquette@linaro.org>
-rw-r--r--kernel/sched/fair.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a6e7beec3b27..422e1f8ab049 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2470,6 +2470,8 @@ static u32 __compute_runnable_contrib(u64 n)
}
unsigned long __weak arch_scale_freq_capacity(struct sched_domain *sd, int cpu);
+void arch_eval_cpu_freq(struct cpumask *cpus);
+void arch_scale_cpu_freq(void);
/*
* We can represent the historical contribution to runnable average as the
@@ -6022,6 +6024,16 @@ unsigned long __weak arch_scale_cpu_capacity(struct sched_domain *sd, int cpu)
return default_scale_cpu_capacity(sd, cpu);
}
+void __weak arch_eval_cpu_freq(struct cpumask *cpus)
+{
+ return;
+}
+
+void __weak arch_scale_cpu_freq(void)
+{
+ return;
+}
+
static unsigned long scale_rt_capacity(int cpu)
{
struct rq *rq = cpu_rq(cpu);