[RFC][PATCH 0/2 -mm] kexec based hibernation -v3

Previous thread: Website info by Kim on Wednesday, September 19, 2007 - 10:28 pm. (1 message)

Next thread: [RFC][PATCH 2/2 -mm] kexec based hibernation -v3: kexec restore by Huang, Ying on Thursday, September 20, 2007 - 1:34 am. (3 messages)
To: Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>
Cc: <linux-kernel@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>
Date: Thursday, September 20, 2007 - 1:34 am

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.

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

3. It is possible to eliminate freezer from kexec based hibernation
implementation.

4. Based on kexec/kdump implementation, the kernel code needed is
less.

This patch set implements the kexec based hibernation. The kernel
functionality added are as follow:

1. Jumping between the kexeced kernel and the original kernel. This is
used by hibernation to save/load necessary state in original kernel
and jumping back to original kernel after restore the memory of
original kernel.

2. Add writing support to /dev/oldmem. This is used by hibernation to
restore the memory of original kernel.

The hibernation procedure with the patch set is as follow:

1. Boot a kernel A

2. Work under kernel A

3. Kexec another kernel B (crash dump enabled) in kernel A.

4. Save the memory image of kernel A through crash dump (such as "cp
/proc/vmcore ~"). Save the "jump back entry".

5. Shutdown or reboot

The restore process with the patch set is as follow:

1. Boot a kernel C (crash dump enabled), the memory area used by
kernel C must be a subset of memory area used by kernel B.

2. Restore the memory image of kernel A through /dev/oldmem. Restore
the "jump back entry".

3. Jump from kernel C back to kernel A

4. Continue work under kernel A

The following user-space tools are needed to implement hibernation and
restore.

1. kexec-tools needs to be patched to support kexec jump. The patches
and the precompiled kexec can be download from the following URL:
source: http://khibernation.sourceforge.net/download/release_20070920/kexec-tool...
patches: [ message continues ]

" title="http://khibernation.sourceforge.net/download/release_20070920/k...">http://khibernation.sourceforge.net/download/release_20070920/k...

To: Huang, Ying <ying.huang@...>
Cc: Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 5:47 am

This steps replaces kernel C's pages with kernel B's (at least 15m-16m),
saved at step 8, so these kernels should be equal? Or they must be
physically located in non-overlapping regions such that C is in B's
memory range but non-overlapping. The proposed setup doesn't guaratee
--Mika

-

To: <linux-pm@...>
Cc: Huang, Ying <ying.huang@...>, Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, Kexec Mailing List <kexec@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 4:43 am

From a short glance over current Linus' arch/i386/kernel/machine_kexec.c,
memory for the crash dump kernel B still needs to be reserved statically when
booting A.

This is one of the biggest issues with kexec based hibernation. For the
typical notebook user, it is totally unacceptable to reserve 16 megabytes of
memory just to be able to suspend to disk. And given the fact that current
distribution kernels are quite modular and require early module loading, even
more memory might be needed.

IMHO, a plan how to fix this must exist or the concept of kexec based
hibernation is a waste of time.

Stefan
-

To: Stefan Rompf <stefan@...>
Cc: <linux-pm@...>, Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, Kexec Mailing List <kexec@...>, <linux-kernel@...>
Date: Friday, September 21, 2007 - 4:47 am

This issue has been resolved. The implementation method details in
another mail with title as follow:

[RFC][PATCH 1/2 -mm] kexec based hibernation -v3: kexec jump

Best Regards,
Huang Ying
-

Previous thread: Website info by Kim on Wednesday, September 19, 2007 - 10:28 pm. (1 message)

Next thread: [RFC][PATCH 2/2 -mm] kexec based hibernation -v3: kexec restore by Huang, Ying on Thursday, September 20, 2007 - 1:34 am. (3 messages)