summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@linux.vnet.ibm.com>2013-06-24 22:08:05 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-07-01 11:49:34 +1000
commitdd023217e17e72b46fb4d49c7734c426938c3dba (patch)
treeab68156166d38800f77502f7bbbc6ba4aa73578b /arch/powerpc
parentec207dcc91c62aeccb65b36c7764076f5e5aaddb (diff)
downloadlinux-0-day-dd023217e17e72b46fb4d49c7734c426938c3dba.tar.gz
linux-0-day-dd023217e17e72b46fb4d49c7734c426938c3dba.tar.xz
powerpc/numa: Do not update sysfs cpu registration from invalid context
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>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/mm/numa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index c792cd95e792e..08397217e8ace 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -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);