My Fights with Standby, Suspend to RAM and Hibernate on Linux
As the electricity prices in the UK continue to climb higher and higher I finally surrendered to the fact that using power efficient systems like diskless and thin clients is not by itself sufficient to provide me with the power bill reduction I would like to have. So I got on the
S2RAM?/Hibernate train. Better late than never.
Caveats and Disappointments
Most of my PCs run
diskless in order to decrease noise, maintenance costs, heat and power consumption. This all is managed via autofs propagated via NIS. Yes, I know it is like using the Death Star main armament to swat mosquitoes, but once sysadmin, you stay sysadmin.
So the first major disappointment with hibernation was that it works extremely bad on diskless or predominantly NFS systems. It takes around 90s for NFS to recover after a prolonged hibernation which makes the use of hibernate pointless. Even on machines with local disks I still keep $HOME and other key areas on a central server with a RAID array. Waiting for these to recover is a major PITA. After trying a number of equally unsuccessful tuneups I gave up and set machines to hibernate only if they have no users logged in and boot OS locally leaving only $HOME and common dirs served by NFS.
This is done using a very simple and dumb script run every 5 minutes which checks if there have been no users logged in for the last 5+ minutes. If that is the case the system tries to unmount autofs mounts and if successful goes into s2ram. The time it takes to reach a usable desktop state after wake-up is still way under 30 seconds (usually around 15) even on relatively slow systems (P3 at 1.4GHz or 1.2GHz Athlon). In fact it is less than on the same system if left always on because the file systejm cache is "frozen" while it is suspended.
User directories are still centrally managed. All machines are still fully interchangeable and any user can login on any machine. So if the significant other's PC is having a "bad hair day" she can still work on junior's PC or my office one without this being a complete disaster.
Standby
Standby on most PCs is utterly useless. With the new tickless kernels, CPU frequency throttle and ACPI support the power consumption is about the same as in idle on most systems. At the same time, some hardware like NVidia does not recover correctly after being put into standby. It is also not supported by
S2RAM?.
I have tried two methods to incorporate Standby into the suspend infrastructure on Linux and I am not happy with either:
- Modify S2RAM? source to use standby and rebuild - change the s2ramgeneric_do function in the S2RAM? source.
- Use Hibernate.
In both cases the system continues to use about as much power as it uses it idle with current kernels. Most importantly - nvidia drivers do not like it and the systems do not recover from it.
S2RAM?
It is good when it works. Unfortunately for most older machines this is the case only on original Intel or Via motherboards. For example HP and Fujitsu/Siemens P3 and P4 using Intel OEM motherboards work. Via EPIA systems usually work as well. HP NC4000 which uses a motherboard by ALI does not. Asus P3 does not work either. Same for a few other MBs I have tried.
Newer machines mostly work out of the box .
My record with it so far has been:
| System |
Status |
Details |
| Laptops |
| NC4000 |
Does not work |
I used to blame it on the Radeon, but it has been the memory all along. It looks like the system does not power/refresh it properly wen S2RAM?-ed. It started suspending and resuming after I changed the original HP 266MHz DIMM under the keyboard with a proper 333MHz one. Once woken up however it throws GPFs all over the place. |
| NC6400 |
Not Tested |
That the brick which my IT department has sentenced me to use. I avoid using it by all means possible so I have not had a chance to try it on it |
| Lenovo Idea Pad - MK1 (Original XP version) |
Works fine, but video brightness is not reset after resume |
All works fine, but the screen is set to the lowest possible brightness level after resume |
| Evo 110 |
Cannot be made to work. Sleep (S1) works instead |
With a lot of hacking sleep (S1) can be made to work. The built in Trident requires a special shutdown procedure similar to the one required by most radeons. However this is not supported by s2ram or hybernate by default |
| Motherboards and Components |
| Asus |
Usually works |
Everything I have from them so far has worked fine. TULS2M? P3 Motherboards, Nvidia 6200 PCI-E, 7600 AGP, Quadro NVS fanless video cards to name a few. |
| MSI |
Usually works |
Even stuff which as old as 6378v3 works perfectly fine. |
| XFX Nvidia 7xxx AGP |
Does not work |
Does not work |
| PNY NVidia 6xxx AGP |
Does not work on most hardware |
Does not work on Asus TULS2M?, Compaq, HP. Works on Fujitsu Siemens P4 small form factor desktops - go figure. |
| Via V Series Motherboard |
Does not work - no S3 support |
It consumes under 20W idle and is too slow for interactive work anyway so the only use for this motherboard is an always-on low power consumption server - firewall, etc |
| Via M Series Motherboards |
Does not work - no S3 support |
Now this is an oxymoron... The first Via proper media system motherboard with MPEG2 accel, etc and no standby mode. |
| BareBones and Systems |
| Fujitsu Siemens Scaleo E |
Works except text consoles |
Like most Intel 9xx systems it works but only in X. Text consoles go black after suspend. |
| HP Thin Client (Geode) |
Does not work - no S3 support |
Another ingenious oxymoron. OK, it does consume only 22W, but the idea of a thin client is that it can consume as little as possible and is nearly instant-on. |
S2Disk?
It works on nearly everything. However, it is rather slow as it has to go through most of the cold boot procedure.
The only modern system I have seen where it fails so far is
Elite ECS GS7610 Super which is probably the worst motherboard I have seen for the last 10 years. Actually, not probably - it is the worst one.