How do I make Powertop's suggestions permanent?

9,929

Powertop is not a permanent tool, as you know, so you will have to setup your system to run the commands through sysctl, udev, systemd units, scripts, whatever...

In order to see what commands are used by powertop you will have to run powertop --html BEFORE MAKING ANY CHANGES, that is, BEFORE toggling the settings from Bad to Good. If you already tuned for maximum battery life, undo your changes and run powertop --html again.

This is what the output should look like:

enter image description here

Share:
9,929

Related videos on Youtube

mattdm
Author by

mattdm

I've been using Linux and Unix professionally since 1995, mostly in Linux-related sysadmin/systems architect jobs supporting academia. I generally know my stuff, but am very happy to learn something new and to be corrected when I'm wrong. Currently, I am the Fedora Project Leader.

Updated on September 18, 2022

Comments

  • mattdm
    mattdm over 1 year

    When I run Powertop, and look at the Tunables screen, about twenty things are listed as Bad. I can toggle these to Good by pressing enter, and when I do so, projected battery lifetime doubles.

    How can I make these changes persist? (I'm on Fedora 18, by the way, with Powertop 2.2)

  • mattdm
    mattdm about 11 years
    I have no /etc/rc.conf. Also, powertop doesn't seem to be suggesting any commands to run. (I think it did that in an older version.)
  • schaiba
    schaiba about 11 years
    Create it if it isn't there. Use powertop --html and open the resulting file, going to the section called 'Software Settings in need of Tuning'
  • mattdm
    mattdm about 11 years
    If I create that file, I'm quite sure it will do nothing on my system. And the html output has no section by that name. There is Optimal Tuned Software Settings, but that just lists items like "Enable SATA link power Managmenet for host0", with no commands.
  • schaiba
    schaiba about 11 years
    My bad, that was meant to be rc.local. Fedora has , IIRC, a systemd unit file that will run that.
  • mattdm
    mattdm about 11 years
    Thanks, yeah, that would work. However, the key problem still stands: powertop --html (or anything else I can see) still doesn't tell me any actual commands. I assume they're mostly kernel tunables, so they really should go in /etc/sysctl.conf or under /etc/sysctl.d/, but I'm not sure what should be set (or to what values).
  • schaiba
    schaiba about 11 years
    I'm not on Fedora, I'm on Arch, and not only I have that section, but I do have the suggested commands. Perhaps anyone using Fedora could help further.
  • mattdm
    mattdm about 11 years
    AH! The part in all caps is exactly what I was missing.
  • mattdm
    mattdm about 11 years
    Excitingly, some of the advice appears to be backwards. For example, it says iw dev wlan0 set power_save off, but turning it on is what changes the setting to "Good".
  • yorkshiredev
    yorkshiredev over 10 years
    Adding some information as I came accross this question : Arch initscripts are handled by systemd, see the wiki for more details : wiki.archlinux.org/index.php/Initscripts
  • Peng
    Peng over 5 years
    There may be particular settings e.g. USB device sleep that you might want to disable from auto-tuning. It'd be nice to have a way to do that.