powerpc/mobility: Extend start/stop topology update scope
diff mbox series

Message ID 20181001185603.11373.61650.stgit@ltcalpine2-lp9.aus.stglabs.ibm.com
State Changes Requested
Headers show
Series
  • powerpc/mobility: Extend start/stop topology update scope
Related show

Checks

Context Check Description
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Michael Bringmann Oct. 1, 2018, 6:56 p.m. UTC
The PPC mobility code may receive RTAS requests to perform PRRN
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>
---
 arch/powerpc/kernel/rtas.c                |    4 ----
 arch/powerpc/mm/numa.c                    |    6 ++++++
 arch/powerpc/platforms/pseries/mobility.c |    5 +++++
 3 files changed, 11 insertions(+), 4 deletions(-)

Comments

Nathan Fontenot Oct. 2, 2018, 7:32 p.m. UTC | #1
On 10/01/2018 01:56 PM, Michael Bringmann wrote:
> The PPC mobility code may receive RTAS requests to perform PRRN
> 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>

> ---
>  arch/powerpc/kernel/rtas.c                |    4 ----
>  arch/powerpc/mm/numa.c                    |    6 ++++++
>  arch/powerpc/platforms/pseries/mobility.c |    5 +++++
>  3 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 8afd146..28d8b57 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -981,8 +981,6 @@ int rtas_ibm_suspend_me(u64 handle)
>  		goto out;
>  	}
> 
> -	stop_topology_update();
> -
>  	/* Call function on all CPUs.  One of us will make the
>  	 * rtas call
>  	 */
> @@ -994,8 +992,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();
> -
>  	/* Take down CPUs not online prior to suspend */
>  	cpuret = rtas_offline_cpus_mask(offline_mask);
>  	if (cpuret)
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index b5a71ba..0ade0a1 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -1518,6 +1518,10 @@ int start_topology_update(void)
>  		}
>  	}
> 
> +	pr_info("Starting topology update%s%s\n",
> +		(prrn_enabled ? " prrn_enabled" : ""),
> +		(vphn_enabled ? " vphn_enabled" : ""));
> +
>  	return rc;
>  }
> 
> @@ -1539,6 +1543,8 @@ int stop_topology_update(void)
>  		rc = del_timer_sync(&topology_timer);
>  	}
> 
> +	pr_info("Stopping topology update\n");
> +
>  	return rc;
>  }
> 
> diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
> index 23fb9ac..49ebefd 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -373,6 +373,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)
> @@ -383,6 +385,9 @@ static ssize_t migration_store(struct class *class,
>  		return rc;
> 
>  	post_mobility_fixup();
> +
> +	start_topology_update();
> +
>  	return count;
>  }
> 
>
Michael Ellerman Oct. 9, 2018, 11:49 a.m. UTC | #2
Michael Bringmann <mwb@linux.vnet.ibm.com> writes:

> The PPC mobility code may receive RTAS requests to perform PRRN
> 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>
> ---
>  arch/powerpc/kernel/rtas.c                |    4 ----
>  arch/powerpc/mm/numa.c                    |    6 ++++++
>  arch/powerpc/platforms/pseries/mobility.c |    5 +++++
>  3 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 8afd146..28d8b57 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -981,8 +981,6 @@ int rtas_ibm_suspend_me(u64 handle)
>  		goto out;
>  	}
>  
> -	stop_topology_update();
> -
>  	/* Call function on all CPUs.  One of us will make the
>  	 * rtas call
>  	 */

This doesn't apply to my next branch, it conflicts with:

  85a88cabad57 ("powerpc/pseries: Disable CPU hotplug across migrations")

Can you please rebase it?

https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/log/?h=next

cheers

Patch
diff mbox series

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 8afd146..28d8b57 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -981,8 +981,6 @@  int rtas_ibm_suspend_me(u64 handle)
 		goto out;
 	}
 
-	stop_topology_update();
-
 	/* Call function on all CPUs.  One of us will make the
 	 * rtas call
 	 */
@@ -994,8 +992,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();
-
 	/* Take down CPUs not online prior to suspend */
 	cpuret = rtas_offline_cpus_mask(offline_mask);
 	if (cpuret)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index b5a71ba..0ade0a1 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1518,6 +1518,10 @@  int start_topology_update(void)
 		}
 	}
 
+	pr_info("Starting topology update%s%s\n",
+		(prrn_enabled ? " prrn_enabled" : ""),
+		(vphn_enabled ? " vphn_enabled" : ""));
+
 	return rc;
 }
 
@@ -1539,6 +1543,8 @@  int stop_topology_update(void)
 		rc = del_timer_sync(&topology_timer);
 	}
 
+	pr_info("Stopping topology update\n");
+
 	return rc;
 }
 
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 23fb9ac..49ebefd 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -373,6 +373,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)
@@ -383,6 +385,9 @@  static ssize_t migration_store(struct class *class,
 		return rc;
 
 	post_mobility_fixup();
+
+	start_topology_update();
+
 	return count;
 }