On my Thinkpad T440s, powertop is reporting a long list of bad parameters in terms of energy consumption. I can switch them to Good manually and be happy, no problem. But what do I have to do to automate this process?
I would like to either set the default permanently, or only activate powertop’s suggestion depending on the AC/battery power supply. Whatever works, but better Good than Bad.
Disclaimer: you should keep in mind that toggling these options is not always safe, your system may hang, you may lose control of some peripheral or even get data corruption, depending on what you’re playing with.
When you enable one of these options, you see the actual command issued at the top left. You can copy these commands to a script or to several scripts, e.g. powersave.sh, aggressive_ps.sh, powerhungry.sh etc. and run them (with elevated privileges) whenever you want. If you are (not?) bored enough, you can also write a udev rule to call a script when you switch from AC to battery or vice versa.
I have always wondered about this, so many options with really no explanation. I never tuned any of them on my ThinkPad X1E and left the “BAD” ones alone. I dont notice too much power consumption as compared to Windows 10, but then I am mostly plugged in.
The powertop package also provides a service that automatically sets all tunables to “Good” for optimal power saving.
Actually, since most of the settings are hardware-dependent and rely on options provided by the different drivers in the kernel, you can find all the information you might want in the relevant sections of the linux kernel documentation.
Some options might be generally safe, or safe for your given circumstances. If for example you have a good UPS or a good battery in your laptop, it is generally safe to increase VM writeback timeout to 15 seconds (or even more). If you have an ethernet port that goes unused, there’s no point in keeping it at maximum power, waiting to negotiate a link that will never happen. As you move to more “vital” components of the system, your mileage may vary. I might consider enabling power save options for spinning disks that exist as spare storage, but I would never do that for disks that are part of a RAID array.
If you want to be prepared for the day that two extra minutes of battery time will make the difference between life and death, make a backup and experiment away. There’s no substitute for experience, as they say.