Powertop

Powertop is a tool provided by Intel to enable various powersaving modes in userspace, kernel and hardware. It is possible to monitor processes and show which of them are utilizing the CPU and wake it from its Idle-States, allowing to identify applications with particular high power demands.

Installation

Install the powertop package.

Usage

Powertop suggests a few methods to reduce the power consumption further. However, in interactive mode, powertop does not display the parameters. To find out which ones are suggested, proceed as follows:

  1. If you have changed parameters (e.g. in powertop), reboot so that the system has default state of the parameters.
  2. Use powertop to produce a report on parameters:
    # powertop --html=powerreport.html
  3. Open the report in your favorite web browser. The "Tuning" tab of the report now shows the actual parameters suggested by the tool to apply to save power. You may extract the commands with
    $ awk -F '</?td ?>' '/tune/ { print $4 }' powerreport.html

Apply settings

There are two ways to automatically apply the suggested settings:

  • Recommended: You can apply these settings at boot by using module parameters, udev rules and sysctl. For details, see the power management page.
  • You can use the --auto-tune feature from powertop which sets all tunable options to their GOOD setting. This can be combined with systemd service to have the tunables set on boot. Remember to enable/start the service.
/etc/systemd/system/powertop.service
[Unit]
Description=Powertop tunings

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/powertop --auto-tune

[Install]
WantedBy=multi-user.target

Troubleshooting

Error: Cannot load from file

If you receive an error like the following when starting powertop, it is likely that powertop has not collected enough measurement data yet. To fix this, keep powertop running for a certain time connected to battery power only.

Loaded 39 prior measurements
Cannot load from file /var/cache/powertop/saved_parameters.powertop
Cannot load from file /var/cache/powertop/saved_parameters.powertop

Calibration to prevent inaccurate measurement

If you experience inaccurate measurement, then it is likely that you need to calibrate powertop first. This can be done by running powertop with the --calibrate parameter.

# powertop --calibrate
gollark: You need to leave home a bit to get food and stuff. It's not a risk you *choose* if someone infects you there because they didn't want to stay at home.
gollark: I would agree with reducing lockdowns in places with very low-utilization hospitals and such. But otherwise not really.
gollark: You can *reduce* the spread...
gollark: Because you can infect other people, it's not *just* bad for you.
gollark: The current situation of printing money, at least, is probably not sustainable.

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.