Power Management on Linux, Part 2
Five Degrees of Laptop OffIn part 1 of this series we learned how to measure how much power our systems are using, both hardware and software, and some tricks for reducing power usage without degrading performance. Today we're going to dive into the world of power management on laptops: ACPI, APM, hard disk spindowns, and spinups.
Power management on laptops is all about squeezing out more battery time. It's a losing battle as laptops get more powerful and use bigger displays. For example, my old Thinkpad R32 runs for three hours on a charge, even on wireless. My shiny new dual-core T61 lasts a bit under two hours. The new machine is brighter and faster, and it has a magnesium roll cage. (Oo la la, like a race car.) Modern laptops with wide glossy screens are lucky to get ninety minutes.
Managing interruptions is a common problem for laptop users. Shutting down and starting up again takes time and eats power. And so we have a confusing array of not-really-off options:
- Off itself, which as we learned in part 1 is usually sort of off and not really off
- S1--On Linux this is usually called "standby." The CPU goes into an idle state and processor caches are flushed. All devices are still powered, the screen blanks, and any other device that is configured to enter an idle state can do so.
- S2--This is included in the ACPI specification, but it's rarely used.
- S3--Suspend to RAM. The contents of the CPU registers are flushed to RAM and the CPU shuts down. Everything should shut down except RAM, including networking.
- S4--Suspend to disk, or hibernate. The current state is written to hard disk, and there should not be any devices drawing power, except for wake-on-LAN network interfaces.
- 1Linux Top 3: Network Security Toolkit, Untangle NG Firewall and IPFire
- 2Linux Top 3: Fedora 24, Peppermint 7 and Solus 1.2
- 3Linux Top 3: Alpine Linux 3.4, deepin 15.2 and Linux Lite 3.0
- 4Linux 4.7 Set to Boost Live Patching, Security and Power Management
- 5Linux 4.6 Charred Weasel adds USB 3.1 Support