LWN.net Logo

Suspend to Disk/RAM

Suspend to Disk/RAM

Posted Jul 20, 2005 17:34 UTC (Wed) by danm628 (subscriber, #5995)
In reply to: The 2005 Linux Kernel Developers' Summit by cborni
Parent article: The 2005 Linux Kernel Developers' Summit

I suspect many people want what I can get from XP on my work notebook (IBM Thinkpad T40). When the lid is shut it does a suspend to RAM, when the lid is opened the system comes up within a couple of seconds. When the system stays in suspend to RAM for a period (I have it set to 15 minutes) it wakes up and does a suspend to disk. I go for weeks without shutting down and rebooting my work notebook. (Actually it can't go for weeks without a reboot, since there will be at least one patch pushed by IT which requires a reboot.)

My home notebook (Thinkpad T41) running Ubuntu isn't quite as flexible. I can do suspend to RAM but there is no option to automatically suspend to disk after staying in suspend to RAM for a period. (Or if there is an option I didn't find it -- which would be a GUI bug not a kernel issue.) Suspend to disk works and it is what I normally do, that way the system comes up fairly quickly when I want to use it. Windows is a *LOT* prettier to watch come out of suspend to disk. I don't mind the odd screen flashes, etc. while the display driver. But I'm sure my non-programmer friends would prefer a nice progress bar instead of kprintf messages.

So what I really want is both suspend to disk and RAM to work reliably. I want to be able to open my notebook and quickly get to work, the definition of quickly depends on how long the notebook has been off (couple of seconds for suspend to RAM or 10 to 20 seconds for suspend to disk). I like being able to shut the lid and know that the system will automatically go to the appropriate low power state. I don't want to have to decide how long I'm going to want it to suspend for and which type of suspend it should do.


(Log in to post comments)

Suspend to Disk/RAM

Posted Jul 22, 2005 20:44 UTC (Fri) by zblaxell (subscriber, #26385) [Link]

If you have working suspend-to-RAM, suspend-to-disk, and ACPI wakeup (echo YYYY-MM-DD HH:MM:SS > /proc/acpi/alarm), it is possible to have the machine arrange to wake itself up in 15 minutes, then suspend to RAM. On resume from RAM, the machine checks the clock and decides to either finish resuming, or suspend to disk. I know this works because I've configured my ex-laptop to do it...but I stopped because the laptop was more often than not in a moving insulated laptop case 15 minutes after suspend, and the CPU would sometimes cook itself in the ~45 seconds required to suspend to disk, especially in summer.

I'd like to see an LVM with a snapshot feature combined with suspend-to-disk, to implement a checkpoint-restart system, with the option of reverting the entire system (RAM and disk) to where it was when it last suspended. The relatively minor data loss of reverting to last suspend before a crash is usually much less painful than reconstructing all the userspace state by hand (literally).

Once the suspend/resume problem is solved, the next most annoying thing about laptops is the game of Russian roulette that is played every time a PCMCIA or USB device is connected. It's especially bad for laptops since they are exposed to more devices per boot than a typical desktop in my experience. If a device with a buggy Linux driver crashes on load, it usually takes the system with it. A checkpoint/restart approach would allow the user to say "oops, guess I'll unplug that and try again" instead of "darn, now I have to spend 20 minutes getting all my user-space stuff put back together."

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.