public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@linux.vnet.ibm.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: len.brown@intel.com, linux-pm@lists.linux-foundation.org
Subject: Re: [PATCH 1/1] PM: Add arch_suspend_disable_nonboot_cpus
Date: Sun, 21 Feb 2010 16:01:09 -0600	[thread overview]
Message-ID: <4B81AD25.5010204@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100221191821.GA2198@ucw.cz>

On 02/21/2010 01:18 PM, Pavel Machek wrote:
> On Sun 2010-02-21 10:32:02, Brian King wrote:
>>
>> Rather than calling disable_nonboot_cpus and enable_nonboot_cpus
>> directly, wrapper the calls in a weak arch_suspend_disable_nonboot_cpus
>> and arch_suspend_enable_nonboot_cpus that can be overridden by
>> architectures that require different handling of suspending processors
>> at suspend time than these functions provide. This is needed to enable
>> suspend/resume on IBM Power servers.
> 
> This needs *way* better explanation. Like: why do power servers
> require special handling? What else is disable_nonboot_cpus used for?

disable_nonboot_cpus ends up calling _cpu_down, which is also used in
the CPU hotplug path.

The issue is essentially that on Power servers, the state that a CPU
needs to be in when hotplug removing it is different than the state it
needs to be in for suspend.

Here is the way that suspend works on Power servers. For each CPU, we
must make a call to the hypervisor (H_JOIN). For all but the last CPU,
this call does not return. For the last CPU, it will return with a
response indicating it is the last hardware thread. At that point, we
need to make a different call (ibm,suspend-me) to the hypervisor to
indicate we are suspending the partition. When the partition resumes,
the CPU thread that made the ibm,suspend-me call will wake up. It then
makes a call to the hypevisor (H_PROD) for each other CPU to wake up the
other CPUs.

So, for Power, the arch_suspend_disable_nonboot_cpus implementation will
call H_JOIN for all other CPUs. Then the suspend enter call just calls
ibm,suspend-me to suspend the partition. On resume,
arch_suspend_enable_nonboot_cpus sends the H_PROD to each CPU, waking it up.

Adding these arch hooks seemed like the cleanest way to accomplish all this.

Thanks,

Brian

-- 
Brian King
Linux on Power Virtualization
IBM Linux Technology Center

  parent reply	other threads:[~2010-02-21 22:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-21 16:32 [PATCH 1/1] PM: Add arch_suspend_disable_nonboot_cpus Brian King
     [not found] ` <20100221191821.GA2198@ucw.cz>
2010-02-21 22:01   ` Brian King [this message]
     [not found]     ` <201002212308.52023.rjw@sisk.pl>
2010-02-21 22:22       ` Brian King
     [not found]         ` <201002212327.13399.rjw@sisk.pl>
2010-02-21 22:28           ` Brian King
     [not found]             ` <201002212337.10462.rjw@sisk.pl>
2010-02-21 22:46               ` Brian King
2010-02-22 19:14                 ` Rafael J. Wysocki
2010-02-22 23:31                   ` Brian King
2010-02-23 15:43                     ` Pavel Machek
2010-02-23 16:41                       ` Brian King
2010-02-23 16:49                         ` Pavel Machek

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=4B81AD25.5010204@linux.vnet.ibm.com \
    --to=brking@linux.vnet.ibm.com \
    --cc=len.brown@intel.com \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@ucw.cz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox