aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorten Rasmussen <Morten.Rasmussen@arm.com>2012-09-14 14:38:14 +0100
committerViresh Kumar <viresh.kumar@linaro.org>2013-01-04 12:25:57 +0530
commit38b813d7efb55a78e249d1b4ba0af2c01d2ad00c (patch)
treee50c0c1e963e8eb7b9911ceda5c0599703d48445
parentd6f82b0bc04ec0ef02cc7f3edb6db8dbc3fe0550 (diff)
downloadvexpress-lsk-38b813d7efb55a78e249d1b4ba0af2c01d2ad00c.tar.gz
ARM: sched: Setup SCHED_HMP domains
SCHED_HMP requires the different cpu types to be represented by an ordered list of hmp_domains. Each hmp_domain represents all cpus of a particular type using a cpumask. The list is platform specific and therefore must be generated by platform code by implementing arch_get_hmp_domains(). Signed-off-by: Morten Rasmussen <Morten.Rasmussen@arm.com>
-rw-r--r--arch/arm/kernel/topology.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index eac7424d372..04271db020c 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -353,6 +353,28 @@ void __init arch_get_fast_and_slow_cpus(struct cpumask *fast,
cpumask_clear(slow);
}
+void __init arch_get_hmp_domains(struct list_head *hmp_domains_list)
+{
+ struct cpumask hmp_fast_cpu_mask;
+ struct cpumask hmp_slow_cpu_mask;
+ struct hmp_domain *domain;
+
+ arch_get_fast_and_slow_cpus(&hmp_fast_cpu_mask, &hmp_slow_cpu_mask);
+
+ /*
+ * Initialize hmp_domains
+ * Must be ordered with respect to compute capacity.
+ * Fastest domain at head of list.
+ */
+ domain = (struct hmp_domain *)
+ kmalloc(sizeof(struct hmp_domain), GFP_KERNEL);
+ cpumask_copy(&domain->cpus, &hmp_slow_cpu_mask);
+ list_add(&domain->hmp_domains, hmp_domains_list);
+ domain = (struct hmp_domain *)
+ kmalloc(sizeof(struct hmp_domain), GFP_KERNEL);
+ cpumask_copy(&domain->cpus, &hmp_fast_cpu_mask);
+ list_add(&domain->hmp_domains, hmp_domains_list);
+}
#endif /* CONFIG_SCHED_HMP */