Kexec jump: The first step to kexec base hibernation
Subsystems (2)
Ying, as the kexec guru in this thread I have a question for you about how kexec works (and possibly where you are going with this)
for the power-off hibernate with ACPI disabled the hibernation seems fairly straightforward (although there are still some missing pieces)
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?
as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
Rafael,
if ACPI is disabled and not used, is there any memory in the origional
kernel that _must not_ be saved in the hibernate image? I recognise that for efficancy it would save time to not save free memory, but if I'm willing to waste some resources would it hurt to save everything?
David Lang
Ying, as the kexec guru in this thread I have a question for you about how kexec works (and possibly where you are going with this)
for the power-off hibernate with ACPI disabled the hibernation seems fairly straightforward (although there are still some missing pieces)
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?
as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
Rafael,
if ACPI is disabled and not used, is there any memory in the origional
kernel that _must not_ be saved in the hibernate image? I recognise that for efficancy it would save time to not save free memory, but if I'm willing to waste some resources would it hurt to save everything?
David Lang
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 27 lines · On Tuesday, 17 July 2007 10:13, [email protected] wrote:
Ying, as the kexec guru in this thread I have a question for you about how kexec works (and possibly where you are going with this)
for the power-off hibernate with ACPI disabled the hibernation seems fairly straightforward (although there are still some missing pieces)
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
Quoted 5 lines
Rafael,
if ACPI is disabled and not used, is there any memory in the origional
kernel that_mustnot_be saved in the hibernate image? I recognise that for efficancy it would save time to not save free memory, but if I'm willing to waste some resources would it hurt to save everything?
On some systems there are valid 'struct page' structures that correspond to memory holes and the kernel will oops if you try to save the contents of these pages. Unfortunately, only the early initialization platform code can tell you which they are.
Greetings,
Rafael
Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
Quoted 27 lines · On Tuesday, 17 July 2007 10:13, [email protected] wrote:
Ying, as the kexec guru in this thread I have a question for you about how kexec works (and possibly where you are going with this)
for the power-off hibernate with ACPI disabled the hibernation seems fairly straightforward (although there are still some missing pieces)
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
Quoted 5 lines
Rafael,
if ACPI is disabled and not used, is there any memory in the origional
kernel that_mustnot_be saved in the hibernate image? I recognise that for efficancy it would save time to not save free memory, but if I'm willing to waste some resources would it hurt to save everything?
On some systems there are valid 'struct page' structures that correspond to memory holes and the kernel will oops if you try to save the contents of these pages. Unfortunately, only the early initialization platform code can tell you which they are.
Greetings,
Rafael
Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
Quoted 11 lines · On Tue, 2007-07-17 at 01:13 -0700, [email protected] wrote:
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
For kernel in 3 that do kexec, the devices and CPU state are saved into memory before executing the new kernel. So when jumping back, the control will continue from kexec point. If the memory image of main kernel is restored from disk, the devices and CPU state in memory is restored too. Before jumping back in 5, the devices are put in the known state, after jumping back, the devices and CPU state is restored. If the "kexec -j" is used to trigger the kexec in 3, the system will continue with "kexec -j" exiting with exit code 0.
Quoted 4 lines
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
I think the early initialization can be done in a initramfs. At that point, the resume image can be checked, the next step depends on the result of checking.
Quoted 3 lines
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
It is possible for hibernate kernel to pass information back to pre-hibernate kernel. For example, the information can be passed in jump buffer page.
Best Regards,
Huang Ying
Quoted 11 lines · On Tue, 2007-07-17 at 01:13 -0700, [email protected] wrote:
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
For kernel in 3 that do kexec, the devices and CPU state are saved into memory before executing the new kernel. So when jumping back, the control will continue from kexec point. If the memory image of main kernel is restored from disk, the devices and CPU state in memory is restored too. Before jumping back in 5, the devices are put in the known state, after jumping back, the devices and CPU state is restored. If the "kexec -j" is used to trigger the kexec in 3, the system will continue with "kexec -j" exiting with exit code 0.
Quoted 4 lines
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
I think the early initialization can be done in a initramfs. At that point, the resume image can be checked, the next step depends on the result of checking.
Quoted 3 lines
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
It is possible for hibernate kernel to pass information back to pre-hibernate kernel. For example, the information can be passed in jump buffer page.
Best Regards,
Huang Ying
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 31 lines · Ying
Quoted 11 lines · On Tue, 2007-07-17 at 01:13 -0700, [email protected] wrote:
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
For kernel in 3 that do kexec, the devices and CPU state are saved into memory before executing the new kernel. So when jumping back, the control will continue from kexec point. If the memory image of main kernel is restored from disk, the devices and CPU state in memory is restored too. Before jumping back in 5, the devices are put in the known state, after jumping back, the devices and CPU state is restored. If the "kexec -j" is used to trigger the kexec in 3, the system will continue with "kexec -j" exiting with exit code 0.
Quoted 4 lines
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
I think the early initialization can be done in a initramfs. At that point, the resume image can be checked, the next step depends on the result of checking.
Quoted 7 lines
Quoted 3 lines
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
It is possible for hibernate kernel to pass information back to pre-hibernate kernel. For example, the information can be passed in jump buffer page.
I think it would be reasonable to have a protocol defined for passing this information, so that it's independent of the kernel version etc.
Greetings,
Rafael
Signature · 6 lines
"Premature optimization is the root of all evil." - Donald Knuth _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 36 lines · Rafael J. Wysocki
Quoted 35 lines · Ying
Quoted 11 lines · On Tue, 2007-07-17 at 01:13 -0700, [email protected] wrote:
however, since the resume designed for ACPI won't work would the following approach work
1. boot one kernel
2. setup a kexec the same way you would for hibernate
3. kexec to the new kernel
4. overwrite the memory of the first kernel
5. kexec 'back' to the main kernel that has now been overwritten by what was saved?as part of this question, when you do a kexec, how does the kernel that you are doing the kexec to know what to run next?
For kernel in 3 that do kexec, the devices and CPU state are saved into memory before executing the new kernel. So when jumping back, the control will continue from kexec point. If the memory image of main kernel is restored from disk, the devices and CPU state in memory is restored too. Before jumping back in 5, the devices are put in the known state, after jumping back, the devices and CPU state is restored. If the "kexec -j" is used to trigger the kexec in 3, the system will continue with "kexec -j" exiting with exit code 0.
Quoted 4 lines
it needs to do some initialization first before it starts running normal things, and at that point it the move back doesn't look for init like a normal kernel boot (or the system would effectivly boot instead of picking up where it left off)
I think the early initialization can be done in a initramfs. At that point, the resume image can be checked, the next step depends on the result of checking.
Quoted 3 lines
is this 'restart point' flexible enough that either the pre-hibernate kerenl or the small hibernate kernel could tell the pre-hibernate kernel to go into suspend-to-ram mode before doing anything else?
Quoted 6 lines
Quoted 3 lines
It is possible for hibernate kernel to pass information back to pre-hibernate kernel. For example, the information can be passed in jump buffer page.
I think it would be reasonable to have a protocol defined for passing this information, so that it's independent of the kernel version etc.
At this point it looks like we have the following communication nessasary between the two kernels
1. the original kernel needs to create a map of what memory to backup
this could be either a bitmap, or a series of address:blockcount pairs. in either case the result could be sizeable, so it's probably best to
define a standard location to find the type and address of the data.
2. the new kernel needs to tell the old kernel which 'restart point' to use.
this could be a simple jump table.
the list that has been suggested so far is
A. restore (the default)
B. suspend-to-ram
C. ACPI suspend-to-disk (S4 mode)
since both kernels have access to the other kernel's memory the data could be stored in either kernel's address space, but my initial thought is that it's cleaner to store this in the original kernel's space and have the second kernel find it there.
I don't have the knowledge to create either of these interfaces, let alone the pull to get them implmented in the kernel.
could I ask that one of you consider makeing a patch that implements at least #1 (the memory map)
it sounds as if these kexec-back patches plus makeing the memory map available would allow for a ACPI-free hibernate mode with no other modifications. I'd like to try experimenting with this, but without the memory map it sounds as if things will croak when I try to do this.
David Lang
Quoted 11 lines · Ying
Quoted 10 lines · Rafael J. Wysocki
Quoted 9 lines
Hibernating process:
1. Normal kernel running
2. Hibernating is triggered,sys_kexec_loadis used to load hibernating kernel and initramfs into memory. Thensys_reboot(LINUX_REBOOT_CMD_KSPAWN)is invoked.
3. Insys_reboot,kexec_jumpis called to save device/CPU state, thenrelocate_kernelis called.kexec_jumpandrelocate_kernelreside in individual page in 16M~512M.
Quoted 7 lines
Quoted 3 lines
OK
What's going to happen to devices at this point?The devices should be quiesced and the state of devices should be saved in
kexec_jump, beforerelocate_kernelis called. This needs the implementation of device hibernating as you mentioned before.
Hmm, at which point devices are normally shut down when kexec is used?
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
4. In
relocate_kernel, 0~16M is backupped firstly, then the hibernating kernel and initramfs is copied to 0~16M, after that, the hibernating kernel is booted.
5. In hibernating kernel, the memory of normal kernel (it is in 16M~512M) is saved into a hibernation image through/dev/memand ELF header.
Quoted 7 lines
Quoted 3 lines
I don't think it can be _that_ simple:
(a) what about processes' memory
(b) what about areas that shouldn't be saved?The
mem_map(struct page[]) of every zone of hibernated kernel is checked. Necessary pages are saved, like memory snapshot of software suspend, but in user space.
Well, it's not enough to check that, sorry. That's why we have register_nosave_region().
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Resume process:
1. Resuming kernel is booted as a normal kernel, but the memory is restricted to 0~16M.
2. Checking whether there is a effective hibernation image. If there isn't, the memory of 16M~512M is hot added, and the normal boot up process continues; If there is, a resuming process is triggered.
3.sys_kexec_loadis used to restore the memory state of hibernated kernel. Thesys_kexec_loadworks in crashdump way, that is, the hibernation image is copied to destination location in 16M~512M insys_kexec_loadinstead ofrelocate_kernel. There is no half of memory size restriction.
4.sys_rebootis called to trigger jumping back, which will jump back tokexec_jumpof hibernated kernel.
5. Inkexec_jumpof hibernated kernel, the memory of 0~16M is copied back from the backup area in 16M~512M. The memory state of hibernated kernel is restored totally. The CPU and device state can be restored after that.
Quoted 8 lines
Quoted 4 lines
Well, I don't know why this needs to be that complicated. We already have code in the mainline that's able to load a large hibernation image into memory and jump to the kernel being restored. And it has _no_ 50% of RAM limitation, this is the _saving_ part of the current code that this limitation comes from.
There is much similarity between
sys_kexec_loadand software resuming. If resuming can be done bysys_kexec_load, then we need not two similar functionality in kernel.
Oh, I see, but your proposed solution seems to be more complicated than that.
Greetings,
Rafael
Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
Quoted 6 lines · Eric W. Biederman
Quoted 2 lines
1. Separate device suspend from device hibernate.
Actually in some very practical sense we already have two copies of this in the kernel.
device_shutdownand the hotunplug/module remove code. So it is should be mostly a matter of using what we have.
Maybe I misuse the terminology. The "device hibernate" here means put device into quiescent state and save the device state into memory for later restore.
But, how to restore device state after jumping back from kexeced kernel if device_shutdown or hotplug/module removing code is used?
Quoted 5 lines
Basically all this entails is to modify
sys_reboot()and adding aLINUX_REBOOT_CMD_KSPAWNand have that command enter the kexec path with the appropriate set of calls. I would be really surprised if this winds up with much more code then the currentkernel_kexecfunction.
Yes, this is the right place to trigger kexec jump. Thank you for your valuable comments. It seems that just the device state quiesce/save/restore and CPU state save/restore code need to be added.
Quoted 9 lines
This might wind up exactly the same as the current
LINUX_REBOOT_CMD_KEXECbut at least until we have a working prototype it makes sense to allow for differences.This should allow the kexec based implementation to coincide with the existing software suspend to disk code until it is proven out and then we can just remove all of the software suspend code to disk code.
Quoted 7 lines
Quoted 4 lines
2. Do not reserve memory for kexec kernel. That is, backup needed memory before kexec and restore them after kexec.
3. Support the in-place kexec? The relocatable kernel is not necessary if this can be implemented.It sounds like what you really want is the normal kexec path enhanced so that you can return to the kernel you started with.
Yes
Quoted 6 lines
The normal kexec path already knows how to do the memory shuffle so it can do on demand memory allocation. That code just needs to enhanced slightly so that you allocate an extra page, setup an inverse scatter gather list for restoring the pages, and teach
relocate_kernel.Sto preserve it's destination pages by using the inverse scatter gather list.
Yes, I have seen that code. The framework of current kexec memory copying can be used for memory backup before kexec.
Quoted 3 lines
The normal kexec path already calls
device_shutdownand the like to stop devices from running. Although again that code path is not prepared to restore the devices.
Yes, the device state quiesce/save/restore and CPU state save/restore code should be added.
Quoted 4 lines
For prototyping I would:
- reserve a chunk of memory (possibly with the crashkernel= option) and run a relocatable kernel out of it.
Quoted 8 lines
By using the normal kexec you can boot a relocatable restore kernel in that reserved region. It is an extra step but it makes things work today.
- I would use the normal
sys_kexec_load.- I would debug/tweak the user space and the code to reenter the old kernel. I.e. the device driver stop/start code.
The above 3 steps are exactly what I have done in this patch. I reserve memory with crashkernel=, use sys_kexec_load (kexec -p ...) to load the kexec kernel and manage to jump back to normal kernel. But I should not mix the kexec jump trigger code with the software suspend code, that is, use "kexec -e", not "echo disk > /sys/power/state".
Quoted 2 lines
Once it was basically working I would the update normal kexec memory copy code in
relocate.Sto preserve the destination pages.
This is what I plan to do.
Quoted 9 lines
Quoted 1 line
4. Image writing/reading. (Only user space application is needed).
And possibly a few fixes to
/dev/mem. This is pretty much the same process as generating a core dump so there should be some synergy with that.We probably want to use something like the ELF header the crashdump path uses to communicate to the kernel saving memory which memory regions need to be saved. Which probably means that we you can use the exact same method as the kexec on panic kernel uses to save memory.
This sound good. The information in ELF header can be used to locate necessary information for image writing.
Quoted 6 lines
Quoted 5 lines
5. A smooth resume process. Maybe it is not needed to kexec a new kernel for resume. For example, in the first stage of kernel boot, just first 16M (or a little more) RAM is used, if the resume image is found, the saved kernel image is resumed; if the resume image is not found, turn on the remaining RAM. This will depends on 3.
Quoted 6 lines
Well I expect the resume will be load the resumed kernel into reserved memory. And kexec a very small assembly stub that will jump back to the code in
relocate_kernel.Swhich will call ret.Then either hot add the rest of our memory or kexec to a kernel without restrictions.
Why a assembly stub is necessary? Is it not sufficient that just continue to complete a normal boot (hot add the reset of memory) or load the hibernated kernel (hibernated image) and jump to it?
Quoted 7 lines
Quoted 3 lines
6. Reduce the boot-up time of kexec kernel. Maybe the kexec kernel can be hibernate/resume by the normal kernel too. This way, a real kexec/boot-up is only needed for the first time.
Well just not loading drivers you aren't going to use and generally avoiding long disk probing times will help here. We control all of the code so it should be relatively straight forward.
Just not loading unnecessary drivers may be sufficient. But further optimization is also possible.
The basic idea of optimization is:
For first run:
1. boot the normal kernel A
2. kexec the hibernate kernel B
3. jump back to kernel A
4. Save the kernel B into a image
5. Work under kernel A.
For normal use:
1. boot the normal kernel A
2. resume the image of kernel B
3. jump to kernel B
4. Save the kernel A into image
Best Regards,
Huang Ying
Quoted 43 lines · Andrew Morton
Quoted 40 lines · Ying
Kexec base hibernation has some potential advantages over uswsusp and 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.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 AThis 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 is 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 next version. That is, instead of reserving memory region previously, the needed memory region is backuped before kexec and restored after jumping back.
Another constrains of the patch is that the
CONFIG_ACPImust 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 hibernation method of the devices as proposed earlier in the LKML.The kexec jump is implemented in the framework of software suspend. In fact, the kexec based hibernation can be seen as just implementing the image writing and reading method of software suspend with a kexeced Linux kernel.
Quoted 6 lines
Quoted 2 lines
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.
This sounds awesome. Am I correct in expecting that ultimately the existing hibernation implementation just goes away and we reuse (and hence strengthen) the existing kexec (and kdump?) infrastructure?
Well, I haven't had the time to look at it more closely, but I'd assume that if we can reuse the kexec infrastructure for hibernation, then yes, the existing implementation will go away.
Quoted 2 lines
And that we get hibernation support almost for free on all kexec (and relocatable-kernel?) capable architectures?
We should be able to, in theory.
Quoted 1 line
And that all the management of hibernation and resume happens in userspace?
I'm not sure what you mean here.
The image saving/loading certainly can be done in the user space.
Quoted 3 lines
I didn't understand the ACPI problem. Does this mean that
CONFIG_ACPImust be disabled in the to-be-hibernated kernel, or in the little transient kexec kernel?
I think that this mechanism requires that devices be not suspended (ie. in low power states).
Greetings,
Rafael
Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
Quoted 6 lines · Andrew Morton
This sounds awesome. Am I correct in expecting that ultimately the existing hibernation implementation just goes away and we reuse (and hence strengthen) the existing kexec (and kdump?) infrastructure?
And that we get hibernation support almost for free on all kexec (and relocatable-kernel?) capable architectures?
And that all the management of hibernation and resume happens in userspace?
Yes. Ultimately, most of the hibernation code such as process freezer, memory shrinking, memory snapshot (atomic copy), image reading/writing can go away, because kexec based hibernation doesn't depend on them. Just the device/CPU state quiescent/save/restore is necessary to remain. And, the management of hibernation and resume will happen in userspace.
Quoted 4 lines
I didn't understand the ACPI problem. Does this mean that
CONFIG_ACPImust be disabled in the to-be-hibernated kernel, or in the little transient kexec kernel?
Under current implementation of device state quiescent/save/restore, the CONFIG_ACPI must be turned off both in to-be-hibernated kernel and transient kexec kernel.
But the hibernation people are going to separate the device suspend from device hibernate. The device hibernate will put device in quiescent state but not in low power state. When this is done, it is not necessary to disable CONFIG_ACPI at all. It is just a workaround for current implementation that disabling CONFIG_ACPI.
Quoted 1 line
How close do you think all this is to being a viable thing?
The kexec jump is the first step, maybe the simplest step. There are many other issues to be resolved, at least the following ones.
1. Separate device suspend from device hibernate.
2. Do not reserve memory for kexec kernel. That is, backup needed memory before kexec and restore them after kexec.
3. Support the in-place kexec? The relocatable kernel is not necessary if this can be implemented.
4. Image writing/reading. (Only user space application is needed).
5. A smooth resume process. Maybe it is not needed to kexec a new kernel for resume. For example, in the first stage of kernel boot, just first 16M (or a little more) RAM is used, if the resume image is found, the saved kernel image is resumed; if the resume image is not found, turn on the remaining RAM. This will depends on 3.
6. Reduce the boot-up time of kexec kernel. Maybe the kexec kernel can be hibernate/resume by the normal kernel too. This way, a real kexec/boot-up is only needed for the first time.
Best Regards,
Huang, Ying