From 3a3814c28b13d038ce5e055fc01f9a7aa5b821b9 Mon Sep 17 00:00:00 2001 From: Michael Holzheu Date: Sat, 1 Aug 2015 18:12:41 +0200 Subject: [PATCH] s390/topology: remove topology lock Since we are already protected by the "sched_domains_mutex" lock, we can safely remove the topology lock. Reviewed-by: Heiko Carstens Signed-off-by: Michael Holzheu Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/topology.c | 11 ++++------- arch/s390/numa/mode_emu.c | 7 ++++++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c index 0f5f8b09c903..1fbe1f83f89c 100644 --- a/arch/s390/kernel/topology.c +++ b/arch/s390/kernel/topology.c @@ -40,8 +40,10 @@ static struct sysinfo_15_1_x *tl_info; static int topology_enabled = 1; static DECLARE_WORK(topology_work, topology_work_fn); -/* topology_lock protects the socket and book linked lists */ -static DEFINE_SPINLOCK(topology_lock); +/* + * Socket/Book linked lists and per_cpu(cpu_topology) updates are + * protected by "sched_domains_mutex". + */ static struct mask_info socket_info; static struct mask_info book_info; @@ -191,7 +193,6 @@ static void tl_to_masks(struct sysinfo_15_1_x *info) { struct cpuid cpu_id; - spin_lock_irq(&topology_lock); get_cpu_id(&cpu_id); clear_masks(); switch (cpu_id.machine) { @@ -202,7 +203,6 @@ static void tl_to_masks(struct sysinfo_15_1_x *info) default: __tl_to_masks_generic(info); } - spin_unlock_irq(&topology_lock); } static void topology_update_polarization_simple(void) @@ -247,10 +247,8 @@ int topology_set_cpu_management(int fc) static void update_cpu_masks(void) { - unsigned long flags; int cpu; - spin_lock_irqsave(&topology_lock, flags); for_each_possible_cpu(cpu) { per_cpu(cpu_topology, cpu).thread_mask = cpu_thread_map(cpu); per_cpu(cpu_topology, cpu).core_mask = cpu_group_map(&socket_info, cpu); @@ -262,7 +260,6 @@ static void update_cpu_masks(void) per_cpu(cpu_topology, cpu).book_id = cpu; } } - spin_unlock_irqrestore(&topology_lock, flags); numa_update_cpu_topology(); } diff --git a/arch/s390/numa/mode_emu.c b/arch/s390/numa/mode_emu.c index 9d4e1e15a6f0..646cd94cff2f 100644 --- a/arch/s390/numa/mode_emu.c +++ b/arch/s390/numa/mode_emu.c @@ -51,6 +51,11 @@ enum {TOPTREE_ID_PHYS, TOPTREE_ID_NUMA}; static int emu_nodes = 1; /* NUMA stripe size */ static unsigned long emu_size; + +/* + * Node to core pinning information updates are protected by + * "sched_domains_mutex". + */ /* Pinned core to node mapping */ static int cores_to_node_id[CONFIG_NR_CPUS]; /* Total number of pinned cores */ @@ -393,7 +398,7 @@ static void print_node_to_core_map(void) * Transfer physical topology into a NUMA topology and modify CPU masks * according to the NUMA topology. * - * This function is called under the CPU hotplug lock. + * Must be called with "sched_domains_mutex" lock held. */ static void emu_update_cpu_topology(void) { -- 2.20.1