diff options
author | Nathan Fontenot <nfont@linux.vnet.ibm.com> | 2013-06-24 23:08:05 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-06-30 21:49:34 -0400 |
commit | dd023217e17e72b46fb4d49c7734c426938c3dba (patch) | |
tree | ab68156166d38800f77502f7bbbc6ba4aa73578b /arch/powerpc/mm | |
parent | ec207dcc91c62aeccb65b36c7764076f5e5aaddb (diff) |
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/mm')
-rw-r--r-- | arch/powerpc/mm/numa.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index c792cd95e792..08397217e8ac 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -1432,11 +1432,9 @@ static int update_cpu_topology(void *data) | |||
1432 | if (cpu != update->cpu) | 1432 | if (cpu != update->cpu) |
1433 | continue; | 1433 | continue; |
1434 | 1434 | ||
1435 | unregister_cpu_under_node(update->cpu, update->old_nid); | ||
1436 | unmap_cpu_from_node(update->cpu); | 1435 | unmap_cpu_from_node(update->cpu); |
1437 | map_cpu_to_node(update->cpu, update->new_nid); | 1436 | map_cpu_to_node(update->cpu, update->new_nid); |
1438 | vdso_getcpu_init(); | 1437 | vdso_getcpu_init(); |
1439 | register_cpu_under_node(update->cpu, update->new_nid); | ||
1440 | } | 1438 | } |
1441 | 1439 | ||
1442 | return 0; | 1440 | return 0; |
@@ -1484,6 +1482,9 @@ int arch_update_cpu_topology(void) | |||
1484 | stop_machine(update_cpu_topology, &updates[0], &updated_cpus); | 1482 | stop_machine(update_cpu_topology, &updates[0], &updated_cpus); |
1485 | 1483 | ||
1486 | for (ud = &updates[0]; ud; ud = ud->next) { | 1484 | for (ud = &updates[0]; ud; ud = ud->next) { |
1485 | unregister_cpu_under_node(ud->cpu, ud->old_nid); | ||
1486 | register_cpu_under_node(ud->cpu, ud->new_nid); | ||
1487 | |||
1487 | dev = get_cpu_device(ud->cpu); | 1488 | dev = get_cpu_device(ud->cpu); |
1488 | if (dev) | 1489 | if (dev) |
1489 | kobject_uevent(&dev->kobj, KOBJ_CHANGE); | 1490 | kobject_uevent(&dev->kobj, KOBJ_CHANGE); |