Thread (1 message) 1 message, 1 author, 2012-06-20

[PATCH v2 3/5] ARM: topology: Update cpu_power according to DT information

From: vincent.guittot@linaro.org (Vincent Guittot)
Date: 2012-06-20 08:43:53
Also in: lkml


On 20 June 2012 03:15, Namhyung Kim [off-list ref] wrote:


On Tue, 19 Jun 2012 10:28:54 +0200, Vincent Guittot wrote:
quoted
Use cpu compatibility field and clock-frequency field of DT to
estimate the capacity of each core of the system and to update
the cpu_power field accordingly.
This patch enables to put more running tasks on big cores than
on LITTLE ones. But this patch doesn't ensure that long running
tasks will run on big cores and short ones on LITTLE cores.

Signed-off-by: Vincent Guittot <redacted>
---
[snip]
quoted
+static void __init parse_dt_topology(void)
+{
+ ? ? struct cpu_efficiency *cpu_eff;
+ ? ? struct device_node *cn = NULL;
+ ? ? unsigned long min_capacity = (unsigned long)(-1);
+ ? ? unsigned long max_capacity = 0;
+ ? ? unsigned long capacity = 0;
+ ? ? int alloc_size, cpu = 0;
+
+ ? ? alloc_size = nr_cpu_ids * sizeof(struct cpu_capacity);
+ ? ? cpu_capacity = (struct cpu_capacity *)kzalloc(alloc_size, GFP_NOWAIT);
+
+ ? ? while ((cn = of_find_node_by_type(cn, "cpu"))) {
+ ? ? ? ? ? ? const u32 *rate, *reg;
+ ? ? ? ? ? ? char *compatible;
+ ? ? ? ? ? ? int len;
+
+ ? ? ? ? ? ? if (cpu >= num_possible_cpus())
+ ? ? ? ? ? ? ? ? ? ? break;
+
+ ? ? ? ? ? ? compatible = of_get_property(cn, "compatible", &len);
Why is this line needed?
not needed is the final version, should have been removed.
quoted
+
+ ? ? ? ? ? ? for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++)
+ ? ? ? ? ? ? ? ? ? ? if (of_device_is_compatible(cn, cpu_eff->compatible))
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? break;
+
+ ? ? ? ? ? ? if (cpu_eff->compatible == NULL)
+ ? ? ? ? ? ? ? ? ? ? continue;
+
+ ? ? ? ? ? ? rate = of_get_property(cn, "clock-frequency", &len);
+ ? ? ? ? ? ? if (!rate || len != 4) {
+ ? ? ? ? ? ? ? ? ? ? pr_err("%s missing clock-frequency property\n",
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? cn->full_name);
+ ? ? ? ? ? ? ? ? ? ? continue;
+ ? ? ? ? ? ? }
+
+ ? ? ? ? ? ? reg = of_get_property(cn, "reg", &len);
+ ? ? ? ? ? ? if (!reg || len != 4) {
+ ? ? ? ? ? ? ? ? ? ? pr_err("%s missing reg property\n", cn->full_name);
+ ? ? ? ? ? ? ? ? ? ? continue;
+ ? ? ? ? ? ? }
+
+ ? ? ? ? ? ? capacity = ((be32_to_cpup(rate)) >> 20)
+ ? ? ? ? ? ? ? ? ? ? * cpu_eff->efficiency;
Why did you break this line?
It was more than 80 chars large previously but no more the case.
I'm going to correct

Thanks
Thanks,
Namhyung




_______________________________________________
linaro-dev mailing list
linaro-dev at lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help