public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Lynch <ntl@pobox.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH -mm][resend] Disable CPU hotplug during suspend
Date: Sat, 29 Jul 2006 16:40:31 -0500	[thread overview]
Message-ID: <20060729214031.GP19076@localdomain> (raw)
In-Reply-To: <200607291418.32366.rjw@sisk.pl>

Rafael J. Wysocki wrote:
> On Saturday 29 July 2006 00:40, Nathan Lynch wrote:
> 
> > But maybe I'm misunderstanding the motivation for using cpu 0 here.  I
> > had assumed it was because on i386 (and others?) the BSP can't be
> > offlined.  Is there some other reason?
> 
> Yes.
> 
> First, the arch-dependent suspend code assumes implicitly that it will be
> running on the BSP, so some strange things may happen if it doesn't.
> 
> Second, we have to make sure that this function will always leaves the
> same CPU online.  It's a bit difficult to explain, but I'll do my best.
> Suppose that disable_nonboot_cpus() exits running on CPU1, assuming it's
> possible.  Then the system memory state saved in the suspend image will
> reflect this situation.  Now the resume code will almost certainly run on the
> BSP (say it's CPU0), but when the system memory is restored from the suspend
> image the kernel will think it's running on CPU1.
> 
> In the last patch I send yesterday I made disable_nonboot_cpus() check if the
> first present CPU, first_cpu(cpu_present_map), is online, try to bring it up
> if not and migrate itself to it before the loop over all online CPUs is run.
> 
> I think that's general enough.

I see, thanks for the explanation.

It doesn't look like SMP swsusp would work reliably on platforms where
there's a possibility of the cpu maps in the resume and saved images
not matching (e.g. ppc64 logical partitions, where cpu 0 could be
removed before suspending).  But I guess that's largely a theoretical
concern at this time. ;)


  reply	other threads:[~2006-07-29 21:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-28  8:15 [PATCH -mm][resend] Disable CPU hotplug during suspend Rafael J. Wysocki
2006-07-28 18:20 ` Nathan Lynch
2006-07-28 19:15   ` Rafael J. Wysocki
2006-07-28 21:23     ` Rafael J. Wysocki
2006-07-28 22:40     ` Nathan Lynch
2006-07-29 12:18       ` Rafael J. Wysocki
2006-07-29 21:40         ` Nathan Lynch [this message]
2006-07-29 23:07           ` Rafael J. Wysocki
2006-07-29  5:15 ` Andrew Morton
2006-07-29 12:27   ` Rafael J. Wysocki

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=20060729214031.GP19076@localdomain \
    --to=ntl@pobox.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    /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