[PATCH 0/2 -mm] kexec based hibernation -v5

Previous thread: [PATCH 2/2 -mm] kexec based hibernation -v5: kexec restore by Huang, Ying on Wednesday, October 10, 2007 - 10:14 pm. (1 message)

Next thread: [QUESTION] I need advice for writing .suspend/.resume functions by Maxim Levitsky on Wednesday, October 10, 2007 - 11:13 pm. (4 messages)
To: Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Rafael J. Wysocki <rjw@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>
Cc: <linux-kernel@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>
Date: Wednesday, October 10, 2007 - 10:13 pm

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.

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_v5/kexec-tools/kexe...
patches: http://khibernation.sourceforge.net/download/release_v5/kexec-tools/kexe...
binary: http://khibernation.sourceforge.net/download/release_v5/kexec-tools/kexe...

2. Memory image saving tool. Currently, the memory image saving is
done through: "cp /proc/vmcore <image file>". This will save all
memory pages of original kernel including the free pages. Maybe the
crash dump tool "makedumpfile" can be used for this, but it has not
been tested.

3. Memory image restore to...

To: Huang, Ying <ying.huang@...>
Cc: Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Rafael J. Wysocki <rjw@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, <linux-kernel@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>
Date: Friday, October 19, 2007 - 3:53 pm

Why is a third kernel needed? Why can't kernel B be used for this as
well? In fact, if kernel A has been compiled to be relocatable and
crash dump enabled, why wouldn't it suffice for all 3 instances?

-

To: Phillip Susi <psusi@...>
Cc: Huang, Ying <ying.huang@...>, Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Rafael J. Wysocki <rjw@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, <linux-kernel@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>
Date: Saturday, October 20, 2007 - 1:50 am

The memory area of kernel B is excluded from the elf header of

One kernel can be used for three situation. In fact, I use just one
kernel for testing.

Best Regards,
Huang Ying
-

To: Phillip Susi <psusi@...>
Cc: Huang, Ying <ying.huang@...>, Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Rafael J. Wysocki <rjw@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, <linux-kernel@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>
Date: Friday, October 19, 2007 - 9:53 pm

you could use one kernel for all three, or you could use three different
kernels, and three different sets of userspace if it's appropriate.

David Lang
-

To: Huang, Ying <ying.huang@...>
Cc: Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, <linux-kernel@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>
Date: Thursday, October 11, 2007 - 6:17 am

This isn't true as long as we have not changed the handling of devices

Well, maybe.

Greetings,
Rafael
-

To: Rafael J. Wysocki <rjw@...>
Cc: Eric W. Biederman <ebiederm@...>, Pavel Machek <pavel@...>, <nigel@...>, Andrew Morton <akpm@...>, Jeremy Maitin-Shepard <jbms@...>, <linux-kernel@...>, <linux-pm@...>, Kexec Mailing List <kexec@...>
Date: Thursday, October 11, 2007 - 11:19 pm

I will add detail description about this. It is possible with TuxOnIce,

I know it has not been implemented yet. I just say that it is possible

Best Regards,
Huang Ying
-

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

When that's implemented, it may be possible to avoid using the freezer for
u/swsusp and TuxOnIce either. Time will tell.

Greetings,
Rafael
-

Previous thread: [PATCH 2/2 -mm] kexec based hibernation -v5: kexec restore by Huang, Ying on Wednesday, October 10, 2007 - 10:14 pm. (1 message)

Next thread: [QUESTION] I need advice for writing .suspend/.resume functions by Maxim Levitsky on Wednesday, October 10, 2007 - 11:13 pm. (4 messages)