powerpc/pseries/mobility: Extend start/stop topology update scope
authorMichael Bringmann <mwb@linux.vnet.ibm.com>
Tue, 9 Oct 2018 20:12:14 +0000 (15:12 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 13 Oct 2018 11:21:25 +0000 (22:21 +1100)
The powerpc mobility code may receive RTAS requests to perform PRRN
(Platform Resource Reassignment Notification) topology changes at any
time, including during LPAR migration operations.

In some configurations where the affinity of CPUs or memory is being
changed on that platform, the PRRN requests may apply or refer to
outdated information prior to the complete update of the device-tree.

This patch changes the duration for which topology updates are
suppressed during LPAR migrations from just the rtas_ibm_suspend_me()
/ 'ibm,suspend-me' call(s) to cover the entire migration_store()
operation to allow all changes to the device-tree to be applied prior
to accepting and applying any PRRN requests.

For tracking purposes, pr_info notices are added to the functions
start_topology_update() and stop_topology_update() of 'numa.c'.

Signed-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/rtas.c
arch/powerpc/mm/numa.c
arch/powerpc/platforms/pseries/mobility.c

index 2c7ed31c736edfdc5a0d9bbdf2e7c79ab8683014..e02ac377ed6408852d6168223db5a02c3c934639 100644 (file)
@@ -982,7 +982,6 @@ int rtas_ibm_suspend_me(u64 handle)
        }
 
        cpu_hotplug_disable();
-       stop_topology_update();
 
        /* Call function on all CPUs.  One of us will make the
         * rtas call
@@ -995,7 +994,6 @@ int rtas_ibm_suspend_me(u64 handle)
        if (atomic_read(&data.error) != 0)
                printk(KERN_ERR "Error doing global join\n");
 
-       start_topology_update();
        cpu_hotplug_enable();
 
        /* Take down CPUs not online prior to suspend */
index 055b211b7126694e1a97643542a8013853ce1c17..693ae1c1acbabb8d16fb427e52e9896385981f20 100644 (file)
@@ -1521,6 +1521,10 @@ int start_topology_update(void)
                }
        }
 
+       pr_info("Starting topology update%s%s\n",
+               (prrn_enabled ? " prrn_enabled" : ""),
+               (vphn_enabled ? " vphn_enabled" : ""));
+
        return rc;
 }
 
@@ -1542,6 +1546,8 @@ int stop_topology_update(void)
                rc = del_timer_sync(&topology_timer);
        }
 
+       pr_info("Stopping topology update\n");
+
        return rc;
 }
 
index 6f27d00505cf49e1b002a98aff2f11ffceca5c66..88925f8ca8a0953c781995107f292b8ac7211b1a 100644 (file)
@@ -360,6 +360,8 @@ static ssize_t migration_store(struct class *class,
        if (rc)
                return rc;
 
+       stop_topology_update();
+
        do {
                rc = rtas_ibm_suspend_me(streamid);
                if (rc == -EAGAIN)
@@ -370,6 +372,9 @@ static ssize_t migration_store(struct class *class,
                return rc;
 
        post_mobility_fixup();
+
+       start_topology_update();
+
        return count;
 }