All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
To: Tyrel Datwyler <tyreld@linux.vnet.ibm.ocm>,
	linuxppc-dev@lists.ozlabs.org
Cc: mpe@ellerman.id.au, nfont@linux.vnet.ibm.com,
	nacc@linux.vnet.ibm.com, stable@vger.kernel.org
Subject: Re: [PATCH] powerpc/pseries: hibernation/migration should honor topology update policy
Date: Fri, 2 Oct 2015 13:57:50 -0700	[thread overview]
Message-ID: <560EEFCE.6050409@linux.vnet.ibm.com> (raw)
In-Reply-To: <1430848434-25793-1-git-send-email-tyreld@linux.vnet.ibm.ocm>

Ping?

Don't thing I ever saw anything happen with this patch. On another note
I notice in retrospect the patch subject isn't really stated in
imperative mood. Maybe it would be better as:

powerpc/pseries: make hibernation/migration honor topology update policy

-Tyrel

On 05/05/2015 10:53 AM, Tyrel Datwyler wrote:
> From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
> 
> The suspend call paths for hibernation and migration operations call
> stop_topology_update() and start_topology_update() respectively prior to
> suspending the LPAR and upon resume. Topology updating can be
> enabled/disabled from userspace and no check is currently done to determine
> the current policy. This results in topology updates being started upon
> resume from hibernation/migration even in the case where topology updates
> were disabled initially.
> 
> This fixes the issue by storing the current policy and only calling
> start_topology_update() in the case where either PRRN/VPHN were enabled to
> start with.
> 
> Fixes: e04fa61214a3 (powerpc/pseries: Add /proc interface to control topology updates)
> 
> Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
> Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
> Cc: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
> Cc: stable@vger.kernel.org
> ---
>  arch/powerpc/include/asm/topology.h      | 5 +++++
>  arch/powerpc/kernel/rtas.c               | 4 +++-
>  arch/powerpc/mm/numa.c                   | 5 +++++
>  arch/powerpc/platforms/pseries/suspend.c | 5 ++++-
>  4 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
> index 5f1048e..44f6519 100644
> --- a/arch/powerpc/include/asm/topology.h
> +++ b/arch/powerpc/include/asm/topology.h
> @@ -63,6 +63,7 @@ static inline void sysfs_remove_device_from_node(struct device *dev,
>  extern int start_topology_update(void);
>  extern int stop_topology_update(void);
>  extern int prrn_is_enabled(void);
> +extern int vphn_is_enabled(void);
>  #else
>  static inline int start_topology_update(void)
>  {
> @@ -76,6 +77,10 @@ static inline int prrn_is_enabled(void)
>  {
>  	return 0;
>  }
> +static inline int vphn_is_enabled(void)
> +{
> +	return 0;
> +}
>  #endif /* CONFIG_NUMA && CONFIG_PPC_SPLPAR */
> 
>  #include <asm-generic/topology.h>
> diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
> index 7a488c1..7ae9992 100644
> --- a/arch/powerpc/kernel/rtas.c
> +++ b/arch/powerpc/kernel/rtas.c
> @@ -906,6 +906,7 @@ int rtas_ibm_suspend_me(u64 handle)
>  	DECLARE_COMPLETION_ONSTACK(done);
>  	cpumask_var_t offline_mask;
>  	int cpuret;
> +	int restart_topology_updates = (prrn_is_enabled() || vphn_is_enabled());
> 
>  	if (!rtas_service_present("ibm,suspend-me"))
>  		return -ENOSYS;
> @@ -957,7 +958,8 @@ int rtas_ibm_suspend_me(u64 handle)
>  	if (atomic_read(&data.error) != 0)
>  		printk(KERN_ERR "Error doing global join\n");
> 
> -	start_topology_update();
> +	if (restart_topology_updates)
> +		start_topology_update();
> 
>  	/* Take down CPUs not online prior to suspend */
>  	cpuret = rtas_offline_cpus_mask(offline_mask);
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index 5e80621..885d950 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -1593,6 +1593,11 @@ int prrn_is_enabled(void)
>  	return prrn_enabled;
>  }
> 
> +int vphn_is_enabled(void)
> +{
> +	return vphn_enabled;
> +}
> +
>  static int topology_read(struct seq_file *file, void *v)
>  {
>  	if (vphn_enabled || prrn_enabled)
> diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
> index e76aefa..b5f92e2 100644
> --- a/arch/powerpc/platforms/pseries/suspend.c
> +++ b/arch/powerpc/platforms/pseries/suspend.c
> @@ -147,6 +147,7 @@ static ssize_t store_hibernate(struct device *dev,
>  {
>  	cpumask_var_t offline_mask;
>  	int rc;
> +	int restart_topology_updates = (prrn_is_enabled() || vphn_is_enabled);
> 
>  	if (!capable(CAP_SYS_ADMIN))
>  		return -EPERM;
> @@ -175,7 +176,9 @@ static ssize_t store_hibernate(struct device *dev,
> 
>  		stop_topology_update();
>  		rc = pm_suspend(PM_SUSPEND_MEM);
> -		start_topology_update();
> +
> +		if (restart_topology_updates)
> +			start_topology_update();
> 
>  		/* Take down CPUs not online prior to suspend */
>  		if (!rtas_offline_cpus_mask(offline_mask))
> 

      parent reply	other threads:[~2015-10-02 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1430848434-25793-1-git-send-email-tyreld@linux.vnet.ibm.ocm>
2015-05-06  2:11 ` [PATCH] powerpc/pseries: hibernation/migration should honor topology update policy Nathan Fontenot
2015-05-06  2:11   ` Nathan Fontenot
2015-10-02 20:57 ` Tyrel Datwyler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560EEFCE.6050409@linux.vnet.ibm.com \
    --to=tyreld@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=nacc@linux.vnet.ibm.com \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=tyreld@linux.vnet.ibm.ocm \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.