Yet another approach to software suspend
Posted Jul 19, 2007 23:12 UTC (Thu) by
i3839 (guest, #31386)
In reply to:
Yet another approach to software suspend by intgr
Parent article:
Yet another approach to software suspend
But the kexec kernel will be the one writing the image and shutting down the machine, after which point it's gone, assuming hibernation. So at "resume" time, the machine just booted up, more or less, and the first kernel that's loaded can be the final one. No place for kexec here.
For the suspend to ram case, switching back is very fast because nothing needs to be done by the "kexec" kernel (in which case it's indeed more a "kvfork" than a "kexec" kernel). But worse, there isn't anything useful to do for the "kexec" kernel in the s2ram case anyway.
> Last time I saw Linus speaking about this, it sounded like he'd kill anyone
> submitting "disk and RAM suspend" unification patches with an axe.
Yeah, I noticed that too, so I'm not overly worried about it happening. ;-)
Sort of ironic that the kexec approach is like the freezer thread on steroids, taking everything much further. The problem is that the stored state should be consistent, there are two ways to achieve that:
1) Prevent that the state changes.
2) Prevent any changes to the state that would cause problems.
The freezer and kexec take the first approach, the latter achieving it arguably much better. Using kexec is tempting because no infrastructure changes are needed or much else. (Maybe it's better to call it the kdump approach instead.) The hard part is to have the required hardware drivers working in the kexec kernel.
To do 2) well more or less all IO needs to be stopped, except for the IO doing the dump image writing. This doesn't seem to be that hard either, but it may add runtime overhead and if you overlook one IO device corruption or less nasty problems can crop up. Advantage is that it should be faster and simpler in the end, though getting there seems like much more work, depending at which level the IO is blocked (if it's done at the driver level then every driver needs to be updated).
(
Log in to post comments)