ARM: sched: Avoid empty 'slow' HMP domain
authorJon Medhurst <tixy@linaro.org>
Thu, 29 Jan 2015 09:01:06 +0000 (18:01 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:41:29 +0000 (13:41 +0900)
On homogeneous (non-heterogeneous) systems all CPUs will be declared
'fast' and the slow cpu list will be empty. In this situation we need to
avoid adding an empty slow HMP domain otherwise the scheduler code will
blow up when it attempts to move a task to the slow domain.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
[k.kozlowski: rebased on 4.1, no signed-off-by of previous committer]
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
arch/arm64/kernel/topology.c

index d9be5c1..a75a8d0 100644 (file)
@@ -354,10 +354,12 @@ void __init arch_get_hmp_domains(struct list_head *hmp_domains_list)
         * 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);
+       if(!cpumask_empty(&hmp_slow_cpu_mask)) {
+               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);