[TRACKING] Linux battery life tuning

@Aidan another thing I noticed is you ran powertop --auto-tune try running powertop --calibrate while on battery instead. It will run the backlight through the paces on its own and help determine what the actual powerdraw will be. It takes about 15 minutes to complete, at whihc point you will need to escape out of it on your own. This will make sure your readings are as accurate as they can be.

I average with Firefox, Evolution , and Terminal between 4-5w. So it is possible but you need to track down the individual cultprits.

Fedora currently uses Wayland as the default for the default GNOME and KDE workstation spin. Other spins do not (yet).

Thanks for directing me toward that reddit thread you added to your earlier reply. Checking /proc/interrupts, I do see a lot of interrupts from “43-fasteoi idma64.2, i2c_designware.2”; more than from any other single source.

I experimented with blacklisting i2c-designware-pci and intel_lpss_pci. The former didn’t do anything. The latter did stop the crazy interrupts… but also disabled my mouse entirely. And, oddly, didn’t make a noticeable change to my power consumption.

Following the directions at the top of this thread, I see that PSR is disabled. Changing the prescribed kernel parameter fails to enable it.

That does sound good, but I think it’s beyond my current linux level.

The default Arch kernel is already compiled with CONFIG_NO_HZ_FULL, so it should use dynticks by default.

After reading all of this thread, I’m fairly convinced that mouse interrupts are the main problem. I exactly replicate the dstat -t --top-int output described by a couple other users: putting a finger on the trackpad changes worst-offender interrupts from < 100 to > 2500.

The people in that thread talk about this issue across various systems, so I’d really like to hear who on linux doesn’t experience absurd mouse-related interrupts.

1 Like

Fedora 37 on the 11th gen i5, purely stock, gets better battery life than my tuned Windows 10 install. It went 24 hours in s2idle and was at 96% when I woke it up. Haven’t checked mouse interrupts but I’ll do so later today.

@Aidan -

Fellow EndeavourOS user here on my 11th Gen i5, KDE on X11, tlp, several boot command line options, etc. My record is ~1.5w idle at graphical desktop, but that was doing crazy get the power down limbo type things. Normal just stop using the mouse idle is 3-4W give or take. I’m away from my machine at the moment so I can’t copy config specifics for you, but it definitely can be done in Endeavour.

Getting PSR working to get the processor to end up in C10 idle will make a pretty big difference by itself, nearly a watt in my testing.

1 Like

@D.H That’s both encouraging and maddening to hear. Looking at powertop’s “idle stats” page and the CSV report it generates, I see contradictory indicitations. I don’t know how to properly read these things; all I can see is that in some places it seems to show that the cores are spending a lot of time in C10, and in others it seems to show that they’re stopping at C6 or C7. Here’s that CSV file.

Is this supposed to imply that you, too, see a dramatic power increase when you touch the trackpad? What’s your dstat -t --top-int readout?

I’d like to hear what your “several boot command line options” are, if you think they’re relevant to power consumption.

I got PSR working, and it didn’t make a big difference. Power consumption is still around 6W at idle.

At what point do I start to consider that this may be a hardware issue? Could I just have a defective chip? Remember: power consumption, and those 2000+/s mouse interrupts, are both fairly consistent across different distros.

I set up my 13 Gen framework last week with Fedora 38 and followed the battery optimization guide by @Matt_Hartley to set up TLP.

With display at 1%, power button LED set to low, 3 x USB C and 1 x USB A, I’m getting an idle just below 3w.

With the display brightness at 20%:

  • Firefox open and idle - 4w
  • Scrolling through Firefox - 9w
  • 1080p video in Firefox - 10w

I’m really impressed how straightforward it was to get set up and super happy with the battery life.

Thank you to the framework team for all the work put into making battery life improvements since launch.

8 Likes

I have not taken power stats in quite some time, so, take all of this with a grain of salt:

HW: 11th gen i5, SK Hynix P31 SSD, 8GBx2 SK Hynix DDR4-3200 RAM
kernel: 6.3.6-arch1-1

I boot via rEFInd, using these cmdline options: root=UUID=99d3cbdf-e1ca-46c2-94e6-xxxxxxxxx rw quiet loglevel=3 nowatchdog acpi_ - Pastebin.com . There is quite possibly no longer needed stuff in there…

I am only using tlp, no ppd, powertop, etc.
tlp.conf: # ------------------------------------------------------------------------------ - Pastebin.com

This is the way (little Star Wars humor).

Appreciate that. :grinning:

2 Likes

Okay, took power measurements again. I have a very specific methodology to look at true idle, and get rid of as many variables as possible.

Hardware as given in my last post.
Booted to arch, plasma graphical desktop over X11
1% screen brightness, keyboard backlight off
Only USB-C expansion cards in
Airplane mode

Nothing running except a konsole terminal running watch cat /sys/class/power_supply/BAT1/current_now

Current_now settled to ~144000, very close to my all time record low of 133000 IIRC. Single touchpad-induced mouse movements spiked the current to ~180000, far better than the spikes to 300000+ I used to see in kernels near 5.18 or so.

Seems like my RZ608 wifi card is a bit more power hungry than the AX210 was, especially with bluetooth turned on. Powertop is reporting almost 4 watts for idle but connected wifi only, nearly 7 with bluetooth turned on. I know powertop’s guesstimates are kind of a wag, but still: Ugh.

Wow less than 3W! I never seem to drop below 8W. Looks like I need to actually tweak tlp with that guide rather than just leaving it as-is. I’m pretty sure I did set the flags for limiting CPU speed on battery at some point though.

I have iwlwifi using over 7W alone though, so maybe something funny is up?

That does not seem right.
For reference, i run F38 KDE on my 12th gen (i5-1240p) and havent done any tinkering (also no tlp).
With Wifi enabled + connected, screen at 30%, i idle at about 3.5w.

If your iwlwifi is using over 7w alone, your system is probably not idle.

2 Likes

What expansion cards were you using? I’m curious whether this idle power is possible with the notorious HDMI card, which on my machine draws a full 1.5 watts.

1 Like

2x USB-A + 2x USB-C
Dont think it’s possible with the „old“ hdmi cards…

1 Like

Got my i7 1370p recently and I can’t get idle power draw to go below like 11w… any ideas (or is this just normal and I don’t know?)
Other hardware:
2x usb-c expansion cards, 2x usb-a expansion cards
64G 3200MT/s teamgroup memory (TEAMGROUP-SD4-3200,) I know that having this much ram might negatively affect battery, but it shouldn’t be this bad, no?
2TB Samsung 980 pro SSD

I have TLP running with settings mostly taken from the wiki page (config below,) nvme acpi off (for suspend,) and deep suspend enabled (because s2idle is trash.) I’m running Kali Linux, which is forked from debian, and running the latest kernel it provides (6.3.)

Relevant Configs:

┌──(gido5731㉿gframe)-[~]
└─$  grep -v -e '^$' -e '^#' /etc/tlp.conf
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave
CPU_ENERGY_PERF_POLICY_ON_AC=performance
CPU_ENERGY_PERF_POLICY_ON_BAT=power
CPU_MIN_PERF_ON_AC=100
CPU_MAX_PERF_ON_AC=50
CPU_MIN_PERF_ON_BAT=0
CPU_MAX_PERF_ON_BAT=40
CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=0
CPU_HWP_DYN_BOOST_ON_AC=1
CPU_HWP_DYN_BOOST_ON_BAT=0
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1
NMI_WATCHDOG=
PLATFORM_PROFILE_ON_AC=performance
PLATFORM_PROFILE_ON_BAT=low-power
INTEL_GPU_MIN_FREQ_ON_AC=800
INTEL_GPU_MAX_FREQ_ON_AC=1500
INTEL_GPU_MAX_FREQ_ON_BAT=500
INTEL_GPU_BOOST_FREQ_ON_AC=1500
RADEON_DPM_PERF_LEVEL_ON_AC=
RADEON_DPM_PERF_LEVEL_ON_BAT=
RADEON_POWER_PROFILE_ON_AC=
RADEON_POWER_PROFILE_ON_BAT=
WIFI_PWR_ON_BAT=off
PCIE_ASPM_ON_AC=default
PCIE_ASPM_ON_BAT=default
USB_DENYLIST="046d:c52b"
RESTORE_THRESHOLDS_ON_BAT=1
                                                                                                                                                                
┌──(gido5731㉿gframe)-[~]
└─$  grep -v -e '^$' -e '^#' /etc/default/grub   
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT='nvme.noacpi=1 module_blacklist=hid_sensor_hub  i915.i915_enable_fbc=1 i915.lvds_downclock=1 drm.vblankoffdelay=1 acpi_osi="!Windows 2020" intel.iommu=on mem_sleep_default=deep'
GRUB_CMDLINE_LINUX=""

Thanks in advance, I will say that, unlike my last laptop (a Tuxedo Pulse 15 Gen 1,) this laptop is way less anxiety inducing on the battery life front because it charges properly from a usb-c brick under 100w, and also has an effective battery life over 20Wh (seriously, the battery is like a year old and at under 25% capacity. I did test it externally as well to make sure the software reading is correct.)

The guide only focusses on TLP, whereas auto-cpufreq seems to be the “modern” approach.
Is there a specific reason why TLP should be preferred?
In addition: for most optimized settings, should TLP and auto-cpufreq be run combined for maximum benefit on a framework?