OSDN Git Service

powerpc/topology: Get topology for shared processors at boot
[tomoyo/tomoyo-test1.git] / arch / powerpc / mm / numa.c
index 0c7e05d..35ac542 100644 (file)
@@ -1078,7 +1078,6 @@ static int prrn_enabled;
 static void reset_topology_timer(void);
 static int topology_timer_secs = 1;
 static int topology_inited;
-static int topology_update_needed;
 
 /*
  * Change polling interval for associativity changes.
@@ -1306,11 +1305,8 @@ int numa_update_cpu_topology(bool cpus_locked)
        struct device *dev;
        int weight, new_nid, i = 0;
 
-       if (!prrn_enabled && !vphn_enabled) {
-               if (!topology_inited)
-                       topology_update_needed = 1;
+       if (!prrn_enabled && !vphn_enabled && topology_inited)
                return 0;
-       }
 
        weight = cpumask_weight(&cpu_associativity_changes_mask);
        if (!weight)
@@ -1423,7 +1419,6 @@ int numa_update_cpu_topology(bool cpus_locked)
 
 out:
        kfree(updates);
-       topology_update_needed = 0;
        return changed;
 }
 
@@ -1551,6 +1546,15 @@ int prrn_is_enabled(void)
        return prrn_enabled;
 }
 
+void __init shared_proc_topology_init(void)
+{
+       if (lppaca_shared_proc(get_lppaca())) {
+               bitmap_fill(cpumask_bits(&cpu_associativity_changes_mask),
+                           nr_cpumask_bits);
+               numa_update_cpu_topology(false);
+       }
+}
+
 static int topology_read(struct seq_file *file, void *v)
 {
        if (vphn_enabled || prrn_enabled)
@@ -1608,10 +1612,6 @@ static int topology_update_init(void)
                return -ENOMEM;
 
        topology_inited = 1;
-       if (topology_update_needed)
-               bitmap_fill(cpumask_bits(&cpu_associativity_changes_mask),
-                                       nr_cpumask_bits);
-
        return 0;
 }
 device_initcall(topology_update_init);