public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: kernel list <linux-kernel@vger.kernel.org>, rusty@rustcorp.com.au
Subject: Re: CPU hotplug on i386
Date: Wed, 16 Mar 2005 15:40:03 +0100	[thread overview]
Message-ID: <200503161540.04480.rjw@sisk.pl> (raw)
In-Reply-To: <20050316132151.GA2227@elf.ucw.cz>

Hi,

On Wednesday, 16 of March 2005 14:21, Pavel Machek wrote:
> Hi!
> 
> I tried to solve long-standing uglyness in swsusp cmp code by calling
> cpu hotplug... only to find out that CONFIG_CPU_HOTPLUG is not
> available on i386. Is there way to enable CPU_HOTPLUG on i386?

Heh, that's exactly what I was thinking about.  ;-)

AFAICS we don't need the full CPU hotplug to do this.  For suspend, we need to
enable the CPU hotplug-related code in sched.c and cpu.c, and we need to
implement the functions __cpu_disable() and __cpu_die() (called from within
cpu.c) on each architecture for which we want swsusp to work on SMP.

If that's acceptable, the CPU hotplug code in sched.c and cpu.c may be
enabled by changing some #ifdefs there.  For example, we could replace the

#idef CONFIG_CPU_HOTPLUG

with

#if defined(CONFIG_CPU_HOTPLUG) || (defined(CONFIG_SOFTWARE_SUSPEND)
	&& defined(CONFIG_SMP))

wherever necessary.

The implementation of __cpu_disable() and __cpu_die() may be a bit more
tricky, however.  In __cpu_disable() we need to save the settings of the local
APIC of each CPU (on x86-64, at least) etc.  In __cpu_die() we should give the
"frozen" CPU some "neutral" code to execute, it seems (or "hlt" it?).

I've looked at the ia64 implementation of these functions, but I haven't fully
understood it yet.

Greets,
Rafael


-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

  reply	other threads:[~2005-03-16 14:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16 13:21 CPU hotplug on i386 Pavel Machek
2005-03-16 14:40 ` Rafael J. Wysocki [this message]
2005-03-17  0:40   ` Nigel Cunningham
2005-03-16 17:09 ` Nathan Lynch
2005-03-16 19:20   ` Zwane Mwaikambo
2005-03-16 23:51   ` Rafael J. Wysocki
2005-03-17  0:04     ` Pavel Machek
2005-03-17  0:16       ` Rafael J. Wysocki
2005-03-16 18:49 ` Nathan Lynch
2005-03-16 20:51   ` Pavel Machek
2005-03-18 11:45 ` 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=200503161540.04480.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rusty@rustcorp.com.au \
    /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