summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorSrivatsa Vaddagiri <vatsa@codeaurora.org>2014-04-15 14:43:57 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:25:58 -0700
commit5796af4921425206827a6005412f43622cbfc0db (patch)
tree3cd1cf810097e64c2c78e1ad67c9d7f487a66650 /arch/arm64
parent1ada6440876e3bbd2c99ce077978fda6d6ef53ca (diff)
arm64: topology: Define arch_get_cpu_efficiency() API for scheduler
On a HMP system, scheduler needs to know efficiency factor (instructions-per-cycle) for various cpus. This is so that scheduler can estimate bandwidth consumption of tasks on each cpu, based on their efficiency factor. This patch defines arch_get_cpu_efficiency() API in ARM64 architecture. It depends on hard-coded "efficiency" factor for various cpu types (available in 'table_efficiency' data structure) and device-tree providing information on cpu-type for every cpu. Change-Id: Ied43ead650ab85b63c232bec14dde500cbcc0f7a Signed-off-by: Srivatsa Vaddagiri <vatsa@codeaurora.org> [joonwoop@codeaurora.org: s/SCHED_POWER/SCHED_CAPACITY/.] Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kernel/topology.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index 36ff723c6813..e562e0f43a42 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -209,6 +209,13 @@ static unsigned long *__cpu_capacity;
static unsigned long middle_capacity = 1;
+static DEFINE_PER_CPU(unsigned long, cpu_efficiency) = SCHED_CAPACITY_SCALE;
+
+unsigned long arch_get_cpu_efficiency(int cpu)
+{
+ return per_cpu(cpu_efficiency, cpu);
+}
+
/*
* Iterate all CPUs' descriptor in DT and compute the efficiency
* (as per table_efficiency). Also calculate a middle efficiency
@@ -288,6 +295,8 @@ static void __init parse_dt_cpu_power(void)
continue;
}
+ per_cpu(cpu_efficiency, cpu) = cpu_eff->efficiency;
+
rate = of_get_property(cn, "clock-frequency", &len);
if (!rate || len != 4) {
pr_err("%s: Missing clock-frequency property\n",