diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2011-11-10 15:10:39 +0100 |
---|---|---|
committer | Vincent Guittot <vincent.guittot@linaro.org> | 2011-11-14 11:10:06 +0100 |
commit | 96881acee427b188f713e8cdfa1e7702ba99477d (patch) | |
tree | 6d99958c05dcb48d5f9d56a557cf67c6dca3a2e6 | |
parent | 91a253b3eb52425b0a445b4dae7bd737b551cd48 (diff) |
ARM: scheduler: add a cpu_power function
Add an architecture specific function for setting cpu_power
Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
-rw-r--r-- | arch/arm/kernel/topology.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index af1c3e68da6..9d80e2254ec 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -45,12 +45,32 @@ struct cputopo_arm cpu_topology[NR_CPUS]; /* + * cpu power scale management + */ + +/* + * a per cpu data structure should be better because each cpu is mainly + * using its own cpu_power even it's not always true because of + * no_hz_idle_balance + */ +static DEFINE_PER_CPU(unsigned int, cpu_scale); + +/* * cpu topology mask management */ unsigned int advanced_topology = 1; /* + * Update the cpu power + */ + +unsigned long arch_scale_freq_power(struct sched_domain *sd, int cpu) +{ + return per_cpu(cpu_scale, cpu); +} + +/* * default topology function */ @@ -281,6 +301,8 @@ void init_cpu_topology(void) cpu_topo->socket_id = -1; cpumask_clear(&cpu_topo->core_sibling); cpumask_clear(&cpu_topo->thread_sibling); + + per_cpu(cpu_scale, cpu) = SCHED_POWER_SCALE; } smp_wmb(); } |