]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/numa: Do not update sysfs cpu registration from invalid context
authorNathan Fontenot <nfont@linux.vnet.ibm.com>
Tue, 25 Jun 2013 03:08:05 +0000 (22:08 -0500)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 1 Jul 2013 01:49:34 +0000 (11:49 +1000)
The topology update code that updates the cpu node registration in sysfs
should not be called while in stop_machine(). The register/unregister
calls take a lock and may sleep.

This patch moves these calls outside of the call to stop_machine().

Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/numa.c

index c792cd95e792e724c17871e6628204a24803ec74..08397217e8ace2d6ce3abc1a09a4fcc14977413f 100644 (file)
@@ -1432,11 +1432,9 @@ static int update_cpu_topology(void *data)
                if (cpu != update->cpu)
                        continue;
 
-               unregister_cpu_under_node(update->cpu, update->old_nid);
                unmap_cpu_from_node(update->cpu);
                map_cpu_to_node(update->cpu, update->new_nid);
                vdso_getcpu_init();
-               register_cpu_under_node(update->cpu, update->new_nid);
        }
 
        return 0;
@@ -1484,6 +1482,9 @@ int arch_update_cpu_topology(void)
        stop_machine(update_cpu_topology, &updates[0], &updated_cpus);
 
        for (ud = &updates[0]; ud; ud = ud->next) {
+               unregister_cpu_under_node(ud->cpu, ud->old_nid);
+               register_cpu_under_node(ud->cpu, ud->new_nid);
+
                dev = get_cpu_device(ud->cpu);
                if (dev)
                        kobject_uevent(&dev->kobj, KOBJ_CHANGE);