arm64: topology: Place all unknown CPUs in a cluster
authorMark Brown <broonie@linaro.org>
Tue, 25 Feb 2014 02:45:16 +0000 (11:45 +0900)
committerMark Brown <broonie@linaro.org>
Tue, 25 Feb 2014 03:31:49 +0000 (12:31 +0900)
The scheduler gets confused if CPUs are not part of the topology when
topology is enabled so assign any otherwise unassigned CPUs to a cluster
after we have finished parsing.

Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/kernel/topology.c

index cb6e0397bec72eadbcbf7231dd2e95054c8f153e..616fe0531536d49a398366d48116640940795332 100644 (file)
@@ -387,4 +387,17 @@ void __init init_cpu_topology(void)
        smp_wmb();
 
        parse_dt_topology();
+
+       /*
+        * Assign all remaining CPUs to a cluster so the scheduler
+        * doesn't get confused.
+        */
+       for_each_possible_cpu(cpu) {
+               struct cputopo_arm *cpu_topo = &cpu_topology[cpu];
+
+               if (cpu_topo->socket_id == -1) {
+                       cpu_topo->socket_id = INT_MAX;
+                       cpu_topo->core_id = cpu;
+               }
+       }
 }