User Tools

Site Tools


software:linux_powersave

What?

I have a Thinkpad T590 with Fedora 36, which is 24deg celsius when idling already spinning up the fan, so collecting hints on saving power. Also, to improve battery life.

Downsides of cooling: depending on what you implement

  • your system might react slower or not at all to requests of higher performance. I.e. lowering maximum cpu/gpu frequency and disabling boost can lead to lower framerates in games, bad performance for video chat software, and so on. Many settings can be done so the system offers power just as needed, so adapts dynamically. Otherwise, you could i.e. with 'tlp stop' before doing video chat do the tuning yourself.
  • security implications: reenabling cpu features which were disabled for security reasons will make the system vulnerable to certain attacks. Be sure to understand this.

First steps

  • verify if you can improve cooling with physical placement: I have the Thinkpad T590 between a Playstation 4 and a fiber modem: that's not ideal for cooling. Already placing some spacers between these devices, so that air can flow between them, can improve cooling.
  • stop unneeded software: run top or htop to see running software. For me, python3 for my sway status bar needs quite some cpu cycles
  • run a slim window manager (sway here).
  • run 'systemctl list-unit-files' to see which services are started, disable and stop unneeded ones.
  • run 'fwupdmgr get-updates' and 'fwupdmgt update' for bios update. Careful, that might also fix cpu security issues which can increase power consumption.

Software for tuning

  • powertop:: Run powertop with the autotune mode, create an /etc/rc.local with the powertune settings. I had to take some of the powertune settings back - powersaving for the usb-connected mouse did lead to the mouse hanging.
  • pcp: I use pcp to watch the temperature sensors + fan in 5min steps. With a config file /etc/pcp/pmrep/sensors.conf I can run 'pmrep :sensors' for that. 'pmrep denki' can also show power consumption of cpu and GPE via RAPL on x86, and general consumption.
  • tlp: modify /etc/tlp.conf, run 'tlp start', use 'tlp-stat' for further tuning.

Kernel tuning

  • potentially: disable cpu mitigations for security issues, i.e. kernel options “noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off”
    • potential win: less consumption for your workload
    • potential downside: opens up the security issues. Benchmark well to see if it's worth it for you!
    • Some of these might also now work, for example T590 firmware disables TSX apparently, so it can not be activated from the linux kernel.
  • “lscpu” shows you which mitigations are in place. “cat /proc/cmdline” shows which kernel options your kernel booted with.
software/linux_powersave.txt · Last modified: 2022/08/03 13:16 by 127.0.0.1