linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Do not update sysfs cpu registration from invalid context
@ 2013-06-24 14:14 Nathan Fontenot
  2013-06-24 17:18 ` Seth Jennings
  2013-06-25  1:50 ` Michael Ellerman
  0 siblings, 2 replies; 8+ messages in thread
From: Nathan Fontenot @ 2013-06-24 14:14 UTC (permalink / raw)
  To: linuxppc-dev

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>
---
 arch/powerpc/mm/numa.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: powerpc/arch/powerpc/mm/numa.c
===================================================================
--- powerpc.orig/arch/powerpc/mm/numa.c	2013-06-24 06:53:31.000000000 -0500
+++ powerpc/arch/powerpc/mm/numa.c	2013-06-24 06:56:30.000000000 -0500
@@ -1433,11 +1433,9 @@
 		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;
@@ -1485,6 +1483,9 @@
 	stop_machine(update_cpu_topology, &updates[0], &updated_cpus);
 
 	for (ud = &updates[0]; ud; ud = ud->next) {
+		unregister_cpu_under_node(update->cpu, update->old_nid);
+		register_cpu_under_node(update->cpu, update->new_nid);
+
 		dev = get_cpu_device(ud->cpu);
 		if (dev)
 			kobject_uevent(&dev->kobj, KOBJ_CHANGE);

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-25  2:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-24 14:14 [PATCH] Do not update sysfs cpu registration from invalid context Nathan Fontenot
2013-06-24 17:18 ` Seth Jennings
2013-06-24 19:16   ` Seth Jennings
2013-06-24 19:25     ` Nathan Fontenot
2013-06-25  1:50       ` Michael Ellerman
2013-06-25  2:46         ` Nathan Fontenot
2013-06-25  1:50 ` Michael Ellerman
2013-06-25  2:47   ` Nathan Fontenot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).