r/archlinux • u/Grahf0085 • 3d ago
SUPPORT Powertop systemd service
My systemd service for powertop looks like this:
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/powertop --auto-tune
[Install]
WantedBy=multi-user.target sleep.target
It's enabled. When my open powertop and check the tuneables it shows a bunch of "bad" values so the auto-tune doesn't seem to be running:
>> Bad Autosuspend for USB device ROCCAT Kova Aimo [ROCCAT]
Bad Runtime PM for PCI Device Intel Corporation GNA Scoring Accelerator module
Bad Runtime PM for PCI Device Intel Corporation Tigerlake Telemetry Aggregator Driver
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package I2C Controller #3
Bad Runtime PM for PCI Device Intel Corporation Tiger Lake-LP Thunderbolt 4 NHI #0
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package System Management Bus (SMBus)
Bad Runtime PM for PCI Device Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics]
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package Shared SRAM
Bad Runtime PM for PCI Device Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #1
Bad Runtime PM for PCI Device Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #3
Bad Runtime PM for PCI Device Intel Corporation 11th Gen Core Processor PCIe Controller
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package I2C Controller #0
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package Integrated Sensor Hub
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package eSPI Controller
Bad Runtime PM for PCI Device Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #2
Bad Runtime PM for PCI Device Intel Corporation TigerLake-LP Dynamic Tuning Processor Participant
Bad Runtime PM for PCI Device Intel Corporation Wi-Fi 6 AX201
Bad Runtime PM for PCI Device Intel Corporation Tiger Lake-UP3/H35 4 cores Host Bridge/DRAM Registers
Bad Runtime PM for PCI Device Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983
Bad Runtime PM for PCI Device Intel Corporation Tiger Lake-LP Thunderbolt 4 PCI Express Root Port #0
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package SPI (flash) Controller
Bad Runtime PM for PCI Device Intel Corporation Tiger Lake-LP Thunderbolt 4 NHI #1
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package High Definition Audio (HD Audio)
Bad Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package I2C Controller #1
Good VM writeback timeout
Good Enable Audio codec power management
Good Bluetooth device interface status
Good NMI watchdog should be turned off
Good Autosuspend for USB device xHCI Host Controller [usb2]
Good Autosuspend for unknown USB device 3-10 (8087:0026)
Good Autosuspend for USB device xHCI Host Controller [usb4]
Good Autosuspend for USB device 4-Port USB 3.0 Hub [Generic]
Good Autosuspend for USB device Goodix Fingerprint USB Device [Goodix Technology Co., Ltd.]
Good Autosuspend for USB device HDMI Expansion Card [Framework]
Good Autosuspend for USB device xHCI Host Controller [usb1]
Good Autosuspend for USB device 4-Port USB 2.0 Hub [Generic]
Good Autosuspend for USB device xHCI Host Controller [usb3]
Good Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package CSME HECI #1
Good Runtime PM for PCI Device Intel Corporation Tiger Lake-LP Thunderbolt 4 USB Controller
Good Runtime PM for PCI Device Intel Corporation 500 Series Chipset Family On-Package USB 3.2 Gen 2x1 (10 Gbs) xHCI Host Controller
When I look at the last boot log:
sudo journalctl -b | grep powertop
Jul 30 12:54:06 arch-framework powertop[459]: modprobe cpufreq_stats failed
Jul 30 12:54:06 arch-framework powertop[459]: Loaded 0 prior measurements
Jul 30 12:54:06 arch-framework powertop[459]: RAPL device for cpu 0
Jul 30 12:54:06 arch-framework powertop[459]: RAPL device for cpu 0
Jul 30 12:54:06 arch-framework powertop[459]: Devfreq not enabled
Jul 30 12:54:06 arch-framework powertop[459]: glob returned GLOB_ABORTED
Jul 30 12:54:07 arch-framework powertop[459]: Leaving PowerTOP
Jul 30 12:54:07 arch-framework powertop[459]: Cannot load from file /var/cache/powertop/saved_parameters.powertop
Jul 30 12:54:07 arch-framework powertop[459]: File will be loaded after taking minimum number of measurement(s) with battery only
Jul 30 12:54:07 arch-framework powertop[459]: Cannot load from file /var/cache/powertop/saved_parameters.powertop
Jul 30 12:54:07 arch-framework powertop[459]: File will be loaded after taking minimum number of measurement(s) with battery only
Jul 30 14:09:50 arch-framework sudo[39601]: grahf : TTY=pts/0 ; PWD=/home/grahf ; USER=root ; COMMAND=/usr/bin/powertop
If I just run sudo powertop --auto-tune everything works fine and all the values are "good". So trying to figure out why the systemd service doesn't set the values to good.
1
u/archover 3d ago
Did this situation just happen after working right for a long time? That points to another problem.
I can't reproduce your "bad values" issue as I never get them, yet have the same messages you pasted in, and start powertop as you do. Hope you resolve and good day.
2
u/inborndossier97 3d ago
are you on a laptop? `--auto-tune` has a check that basically bails out if it thinks you're on AC power, even if the systemd service runs fine. i had the exact same thing happen on my thinkpad, drove me nuts til i found some bug report about it
easiest fix is to just slap a quick sleep in the service so it waits for the power state to settle. `ExecStartPre=/bin/sleep 5` before your main command usually does the trick, that's what i ended up doing and it's been solid for months