mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Huang, Ying" <ying.huang@intel.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Pavel Machek <pavel@ucw.cz>,
	nigel@nigel.suspend2.net, Jeremy Maitin-Shepard <jbms@cmu.edu>,
	Alan Stern <stern@rowland.harvard.edu>,
	Andrew Morton <akpm@linux-foundation.org>,
	david@lang.hm, linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org,
	Kexec Mailing List <kexec@lists.infradead.org>
Subject: Re: [PATH 0/1] Kexec jump - v2 - the first step to kexec based hibernation
Date: Sun, 15 Jul 2007 12:09:05 +0200	[thread overview]
Message-ID: <200707151209.06529.rjw@sisk.pl> (raw)
In-Reply-To: <1184483593.1898.98.camel@caritas-dev.intel.com>

On Sunday, 15 July 2007 09:13, Huang, Ying wrote:
> The changelog between v1 and v2
> 
> 1. The kexec jump implementation is put into the kexec/kdump
>    framework instead of software suspend framework. The device
>    and CPU state save/restore code of software suspend is called
>    when needed.
> 
> 2. The same code path is used for both kexec a new kernel and jump
>    back to original kernel.
> 
> The complete changelog of the patch is as follow:
> 
> ---
> 
> Kexec base hibernation has some potential advantages over uswsusp and
> TuxOnIce (suspend2). Some most obvious advantages are:
> 
> 1. The hibernation image size can exceed half of memory size easily.

In TuxOnIce (suspend2) there's no such limitation.

> 2. The hibernation image can be written to and read from almost
>    anywhere, such as USB disk, NFS.

You can do this, too, with uswsusp.

> This patch implements the functionality of "jumping from kexeced
> kernel to original kernel". That is, the following sequence is
> possible:
> 
> 1. Boot a kernel A
> 2. Work under kernel A
> 3. Kexec another kernel B in kernel A
> 4. Work under kernel B
> 5. Jump from kernel B to kernel A
> 6. Continue work under kernel A
> 
> This is the first step to implement kexec based hibernation. If the
> memory image of kernel A is written to or read from a permanent media
> in step 4, a preliminary version of kexec based hibernation can be
> implemented.
> 
> The kernel B run as a crashdump kernel in reserved memory region. This
> is the biggest constrains of the patch. It is planed to be eliminated
> in the future version. That is, instead of reserving memory region
> previously, the needed memory region is backupped before kexec and
> restored after jumping back.
> 
> Another constrains of the patch is that the CONFIG_ACPI must be turned
> off to make kexec jump work. Because ACPI will put devices into low
> power state, the kexeced kernel can not be booted properly under
> it. This constrains can be eliminated by separating the suspend method
> and hibernate method of the devices as proposed earlier in the LKML.
> 
> The kexec jump is implemented in the framework of kexec/kdump. In
> sys_reboot, a new command named LINUX_REBOOT_CMD_KJUMP is defined to
> trigger the jumping to (executing) the new kernel or jump back to the
> original kernel.
> 
> Now, only the i386 architecture is supported. The patch is based on
> Linux kernel 2.6.22, and has been tested on my IBM T42.
> 
> Usage:
> 
> 1. Compile kernel with following options selected:
> 
> CONFIG_X86_32=y
> CONFIG_RELOCATABLE=y # not needed strictly, but it is more convenient with it
> CONFIG_KEXEC=y
> CONFIG_PM=y
> CONFIG_KEXEC_JUMP=y
> 
> 2. Compile the kexec-tools with kdump and kjump patches, the
>    kdump patch can be found at:
> 
> http://lse.sourceforge.net/kdump/patches/kexec-tools-1.101-kdump10.patch
> 
>    While, the kexec-tools kjump patch is appended with the mail.
> 
> 3. Boot kernel compiled for normal usage, the reserved crash kernel
>    memory region must be added to kernel command line as following:
> 
>    crashkernel=<XX>M@<XX>M
> 
>    Where, <XX> should be replaced by the real memory size and position.
> 
> 4. Load kernel compiled for hibernating usage as a crashdump kernel
>    with kexec, the same kernel as that of 3 can be used if
>    CONFIG_RELOCATABLE=y is selected. The kernel command line option as
>    following must be appended to kernel command line.
> 
>    kexec_jump_buf_pfn=`cat /sys/kernel/kexec_jump_buf_pfn`
> 
>    For example, the shell command line can be as follow:
> 
>    kexec -p /boot/vmlinux --args-linux --append="root=/dev/hdb signal
>        kexec_jump_buf_pfn=`cat /sys/kernel/kexec_jump_buf_pfn`"
> 
> 5. Boot the hibernating kernel with following shell command line:
> 
>    kexec -j
> 
> 6. In the kexec booted kernel, trigger the jumping back with following
>    shell command.
> 
>    kexec -j

Well, I think that's _way_ too much complicated to be useful for hibernation
on systems that are set up and administered by average users.

Greetings,
Rafael


-- 
"Premature optimization is the root of all evil." - Donald Knuth

  parent reply	other threads:[~2007-07-15 10:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-15  7:13 Huang, Ying
2007-07-15  9:08 ` Nigel Cunningham
2007-07-15 10:09 ` Rafael J. Wysocki [this message]
2007-07-19  1:04 ` Andrew Morton
2007-07-19  2:15   ` Nigel Cunningham
2007-07-19  3:30     ` david
2007-07-19  6:43   ` Huang, Ying
2007-07-19  9:13     ` Rafael J. Wysocki
2007-07-31  9:10 ` Pavel Machek
2007-07-31  9:25   ` Huang, Ying
2007-07-31 10:52     ` Eric W. Biederman
2007-07-31 11:12       ` Pavel Machek
2007-08-01  1:16       ` Huang, Ying
2007-07-31 11:14     ` Pavel Machek
2007-07-31 11:04 ` Pavel Machek
2007-08-01  1:34   ` Huang, Ying
2007-08-05 18:55     ` Pavel Machek
2007-08-06  2:31       ` Huang, Ying
2007-08-06  9:02         ` Pavel Machek
2007-08-06 13:22           ` Huang, Ying

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=200707151209.06529.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=david@lang.hm \
    --cc=ebiederm@xmission.com \
    --cc=jbms@cmu.edu \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    --cc=stern@rowland.harvard.edu \
    --cc=ying.huang@intel.com \
    /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

all inboxes | Powered by JetHome®