aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/topology.h
diff options
context:
space:
mode:
authorThiago Jung Bauermann <[email protected]>2017-06-20 19:08:30 -0300
committerThomas Gleixner <[email protected]>2017-06-23 09:32:11 +0200
commit3e401f7a2e5199151f735aee6a5c6b4776e6a35e (patch)
tree39a4c4f95362a6a34bede2b3f7c3c4097b43db44 /arch/powerpc/include/asm/topology.h
parent1b3b22507e0d45dedc6a54b26d56e0b8c4d36875 (diff)
powerpc: Only obtain cpu_hotplug_lock if called by rtasd
Calling arch_update_cpu_topology from a CPU hotplug state machine callback hits a deadlock because the function tries to get a read lock on cpu_hotplug_lock while the state machine still holds a write lock on it. Since all callers of arch_update_cpu_topology except rtasd already hold cpu_hotplug_lock, this patch changes the function to use stop_machine_cpuslocked and creates a separate function for rtasd which still tries to obtain the lock. Michael Bringmann investigated the bug and provided a detailed analysis of the deadlock on this previous RFC for an alternate solution: Signed-off-by: Thiago Jung Bauermann <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Michael Ellerman <[email protected]> Cc: John Allen <[email protected]> Cc: Michael Bringmann <[email protected]> Cc: Nathan Fontenot <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Link: https://patchwork.ozlabs.org/patch/771293/
Diffstat (limited to 'arch/powerpc/include/asm/topology.h')
-rw-r--r--arch/powerpc/include/asm/topology.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index 8b3b46b7b0f2..a2d36b7703ae 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -43,6 +43,7 @@ extern void __init dump_numa_cpu_topology(void);
extern int sysfs_add_device_to_node(struct device *dev, int nid);
extern void sysfs_remove_device_from_node(struct device *dev, int nid);
+extern int numa_update_cpu_topology(bool cpus_locked);
#else
@@ -57,6 +58,11 @@ static inline void sysfs_remove_device_from_node(struct device *dev,
int nid)
{
}
+
+static inline int numa_update_cpu_topology(bool cpus_locked)
+{
+ return 0;
+}
#endif /* CONFIG_NUMA */
#if defined(CONFIG_NUMA) && defined(CONFIG_PPC_SPLPAR)