All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v02] powerpc/mobility: Extend start/stop topology update scope
@ 2018-10-09 20:12 Michael Bringmann
  2018-10-10 16:24 ` Nathan Fontenot
  2018-10-15  4:01 ` [v02] " Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Bringmann @ 2018-10-09 20:12 UTC (permalink / raw)
  To: linuxppc-dev, mwb
  Cc: Nathan Fontenot, Juliet Kim, Thomas Falcon, Tyrel Datwyler

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>
---
Changes in v02:
  -- Rebase to latest powerpc next tree.
---
 arch/powerpc/kernel/rtas.c                |    2 --
 arch/powerpc/mm/numa.c                    |    6 ++++++
 arch/powerpc/platforms/pseries/mobility.c |    5 +++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 2c7ed31..e02ac37 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -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 */
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 2f0f512..7da222d 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -367,6 +367,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)
@@ -377,6 +379,9 @@ static ssize_t migration_store(struct class *class,
 		return rc;
 
 	post_mobility_fixup();
+
+	start_topology_update();
+
 	return count;
 }
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v02] powerpc/mobility: Extend start/stop topology update scope
  2018-10-09 20:12 [PATCH v02] powerpc/mobility: Extend start/stop topology update scope Michael Bringmann
@ 2018-10-10 16:24 ` Nathan Fontenot
  2018-10-15  4:01 ` [v02] " Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Fontenot @ 2018-10-10 16:24 UTC (permalink / raw)
  To: Michael Bringmann, linuxppc-dev; +Cc: Juliet Kim, Thomas Falcon, Tyrel Datwyler

On 10/09/2018 03:12 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>

> ---
> Changes in v02:
>   -- Rebase to latest powerpc next tree.
> ---
>  arch/powerpc/kernel/rtas.c                |    2 --
>  arch/powerpc/mm/numa.c                    |    6 ++++++
>  arch/powerpc/platforms/pseries/mobility.c |    5 +++++
>  3 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 2c7ed31..e02ac37 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -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 */
> 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 2f0f512..7da222d 100644
> --- a/arch/powerpc/platforms/pseries/mobility.c
> +++ b/arch/powerpc/platforms/pseries/mobility.c
> @@ -367,6 +367,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)
> @@ -377,6 +379,9 @@ static ssize_t migration_store(struct class *class,
>  		return rc;
> 
>  	post_mobility_fixup();
> +
> +	start_topology_update();
> +
>  	return count;
>  }
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [v02] powerpc/mobility: Extend start/stop topology update scope
  2018-10-09 20:12 [PATCH v02] powerpc/mobility: Extend start/stop topology update scope Michael Bringmann
  2018-10-10 16:24 ` Nathan Fontenot
@ 2018-10-15  4:01 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-10-15  4:01 UTC (permalink / raw)
  To: Michael Bringmann, linuxppc-dev, mwb
  Cc: Nathan Fontenot, Juliet Kim, Thomas Falcon, Tyrel Datwyler

On Tue, 2018-10-09 at 20:12:14 UTC, 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>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/65b9fdadfc4d87e2577b791fb3495c

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-15  4:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 20:12 [PATCH v02] powerpc/mobility: Extend start/stop topology update scope Michael Bringmann
2018-10-10 16:24 ` Nathan Fontenot
2018-10-15  4:01 ` [v02] " Michael Ellerman

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.