All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] powerpc/topology: Update numa mask when cpu node mapping changes
@ 2018-10-16 14:58 Srikar Dronamraju
  0 siblings, 0 replies; only message in thread
From: Srikar Dronamraju @ 2018-10-16 14:58 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Srikar Dronamraju, Michael Bringmann

Commit 2ea626306810 ("powerpc/topology: Get topology for shared
processors at boot") will update the cpu node topology for shared lpars
on PowerVM.

However shared lpars on PowerVM also support VPHN and PRRN events.
On receiving a VPHN, PRRN events, cpu to node mapping might change.

Scheduler maintains sched_domains_numa_masks[], which is currently not
updated on cpu to node mapping changes. This can lead to machine
hangs or performance hit.

Fix numa_update_cpu_topology() to update sched_domains_numa_masks[].

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
---
Changelog: v1->v2:
- Updated changelog.
- Updated comments to refer to topology_inited.

 arch/powerpc/mm/numa.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 3ea5b05ee6be..767c363ebafa 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -29,6 +29,7 @@
 #include <linux/seq_file.h>
 #include <linux/uaccess.h>
 #include <linux/slab.h>
+#include <linux/sched/hotplug.h>
 #include <asm/cputhreads.h>
 #include <asm/sparsemem.h>
 #include <asm/prom.h>
@@ -1424,6 +1425,20 @@ int numa_update_cpu_topology(bool cpus_locked)
 		changed = 1;
 	}
 
+	/*
+	 * Scheduler maintains a sched_domain_numa_masks table that needs to
+	 * be updated whenever cpu-node mapping changes. Cpu-node mapping
+	 * changes only with VPHN and PRRN. 'topology_inited' indicates if
+	 * cpu-hotplug infrastructure is initialized and good to use.
+	 */
+	if (!(topology_inited && (vphn_enabled || prrn_enabled)))
+		goto out;
+
+	for_each_cpu(cpu, &updated_cpus) {
+		sched_cpu_deactivate(cpu);
+		sched_cpu_activate(cpu);
+	}
+
 out:
 	kfree(updates);
 	topology_update_needed = 0;
-- 
2.12.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-16 15:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-16 14:58 [PATCH v2] powerpc/topology: Update numa mask when cpu node mapping changes Srikar Dronamraju

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.