How about standby & hibernate together
PCs can go into standby mode (just enough power to preserve the RAM and do wake-on-lan) and into hibernate mode (where they write out the RAM to disk, shut down entirely and restore from disk later) as well as fully shut down.
Standby mode comes back up very fast, and should be routinely used on desktops. In fact, non-server PCs should consider doing it as a sort of screen saver since the restart can be so quick. It's also popular on laptops but does drain the battery in a few days keeping the RAM alive. Many laptops will wake up briefly to hibernate if left in standby so long that the battery gets low, which is good.
How about this option: Write the ram contents out to disk, but also keep the ram alive. When the user wants to restart, they can restart instantly, unless something happened to the ram. If there was a power flicker or other trouble, notice the ram is bad and restart from disk. Usually you don't care too much about the extra time needed to write out to disk when suspending, other than for psychological reasons where you want to be really sure the computer is off before leaving it. It's when you come back to the computer that you want instant-on.
In fact, since RAM doesn't actually fail all that quickly, you might even find you can restore from RAM after a brief power flicker. In that case, you would want to store a checksum for all blocks of RAM, and restore any from disk that don't match the checksum.
To go further, one could also hibernate to newer generations of fast flash memory. Flash memory is getting quite cheap, and while older generations aren't that quick, they seek instantaneously. This allows you to reboot a machine with its memory "paged out" to flash, and swap in pages at random as they are needed. This would allow a special sort of hybrid restore:
- Predict in advance which pages are highly used, and which are enough to get the most basic functions of the OS up. Write them out to a special contiguous block of hibernation disk. Then write out the rest, to disk and flash.
- When turning on again, read this block of contiguous disk and go "live." Any pages needed can then be paged in from the flash memory as needed, or if the flash wasn't big enough, unlikely pages can come from disk.
- In the background, restore the rest of the pages from the faster disk. Eventually you are fully back to ram.
This would allow users to get a fairly fast restore, even from full-off hibernation. If they click on a rarely used program that was in ram, it might be slow as stuff pages in, but still not as bad as waiting for the whole restore.
Comments
Scott Laird
Tue, 2008-05-06 17:42
Permalink
That's basically what OS X does
Mac laptops work just like that. When you close the lid, they write everything out to disk and then go into standby mode. If you reopen the lid, they're ready to use in a second or so. If the power dies, then it'll restore from disk when the power comes back. They don't seem to do the checksum trick on preserved RAM; I suspect that Intel's RAM controllers don't support it.
The downside is that writing 2-4 GB of RAM out to disk takes time, and it's uninterruptable. So, if you close you lid and then realize that you forgot something, it'll be 20+ seconds before you can get access to your computer again, and possibly much longer.
brad
Tue, 2008-05-06 18:55
Permalink
Again apple gets it right
I guess I never tried that on one. However, only partly right. It should be extremely rare that you start something and you can't stop it, just as you should always be able to undo except very special operations. Over time people will figure this out.
Sterling
Thu, 2008-05-08 08:18
Permalink
Another downside
I use standby very frequently on my laptop, which I literally use on my lap quite often. And one reason I really like to see standby happen quickly is so that I know I can move the machine safely, without the chance of a disk head impacting a spinning platter.
So I wouldn't like the computer to automatically hibernate when I all I want is for it to suspend. As Scott says above, writing a couple of gig to disk takes a bit of time, and that's time when I can't be moving the laptop.
brad
Thu, 2008-05-08 11:45
Permalink
More for desktops
Yes, I think this is better for desktops than laptops. The power of standby mode is not an issue, but the loss of state in a power interruption is.
Now what I really want, which I will blog about later is a "sleepwalking" mode where the computer goes very low power, but still has a processor, memory, a few sensors and wired ethernet active (at least at the WoL level.) This could be a way of running your real processor at the lowest possible clock, or it could even justify having a super-low-power microcontroller on the bus.
Among the things sleepwalk mode could do is watch accelerometers and figure out when you have put the computer down for a while, and then wake up the real computer to perform the hibernate. And abort the hibernate if you pick the computer up.
I have a few other goals for sleepwalking mode that I will blog about later.
justin
Tue, 2009-06-23 15:34
Permalink
Have you found a solution
I've been searching for a way to do this exact thing. Is there a program or command available for a WinXP machine to do the Mac-style "write to disk then standby"?
Add new comment