diff mbox series

[v08,5/5] hotplug/pmt: Update topology after PMT

Message ID 99ac2a52-ac84-0e5b-bedc-ce029c1684cf@linux.vnet.ibm.com (mailing list archive)
State Rejected
Headers show
Series powerpc/hotplug: Update affinity for migrated CPUs | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/checkpatch success Test checkpatch on branch next
snowpatch_ozlabs/build-ppc64le warning Test build-ppc64le on branch next
snowpatch_ozlabs/build-ppc64be warning Test build-ppc64be on branch next
snowpatch_ozlabs/build-ppc64e success Test build-ppc64e on branch next
snowpatch_ozlabs/build-ppc32 success Test build-ppc32 on branch next

Commit Message

Michael Bringmann July 29, 2018, 1:19 p.m. UTC
hotplug/pmt: Invoke rebuild_sched_domains before applying any CPU
'readd' modifications.  The call leads to arch_update_cpu_topology()
which will recognize and report any changes to the CPU topology
are now applied, and that the relevant system data structures are
updated.  It may also initialize nodes that were unused in the
topology of the source migration system.  This will avoid some
locking synchronization issues that were observed during development
of this patch set.  Also, the addition of the explicit call ensures
that such changes are made even when the automatic topology update
worker, triggered by a timer, has been disabled.

Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
---
Changes in patch:
  -- Add information to description.
  -- Remove long ssleep calls
  -- Rearrange code to perform rebuild before any other PMT mods
---
 arch/powerpc/platforms/pseries/dlpar.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 13ac1cc..2de0f0d 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -16,6 +16,7 @@ 
 #include <linux/notifier.h>
 #include <linux/spinlock.h>
 #include <linux/cpu.h>
+#include <linux/cpuset.h>
 #include <linux/slab.h>
 #include <linux/of.h>
 
@@ -437,6 +438,17 @@  static int dlpar_pmt(struct pseries_hp_errorlog *work)
 {
 	struct list_head *pos, *q;
 
+	/* Rebuild the domains and init any memoryless nodes
+	 * first to avoid later sync issues with CPU readd.
+	 */
+	rebuild_sched_domains();
+	msleep(100);
+		/* Ensure that the worker for rebuild_sched_domains
+		 * has the opportunity to actually begin work as we
+		 * don't want it delayed by the CPU readd hotplug
+		 * locking.
+		 */
+
 	list_for_each_safe(pos, q, &dlpar_delayed_list) {
 		struct pseries_hp_errorlog *tmp;