[TRACKING] Linux battery life tuning

I’m seeing something strange: deep is using more power than s2idle. Anyone else see this?

I have a 12th Gen with Debian Bookworm A1 (kernel 5.19.11-1). Letting the system suspend for about 10hrs in s2idle results in about 7% battery loss. If I use deep, an overnight suspend uses 15%. I have not tuned or set any other parameters.

Note that I used echo deep... for testing. I’ll try with a boot variable and initram update. Maybe the setting isn’t completely taking with only the echo change? Also note I used systemctl suspend instead of letting the power manager timer initiate the suspend. Not sure that matters but it is different than my previous tests.

1 Like

In my tests, deep is what made the most radical change (apart from removing costly expansion cards) in standby usage, so no, I haven’t seen that yet. :slight_smile:

1 Like

I didn’t see a significant change after adding that boot option. Debian GNU/Linux testing/bookworm, Linux 5.19.11, WD Blue SN570 1TB SSD version 234100WD. LVFS says it has no pending firmware upgrade.

Detailed notes in this section of my review. I’m seeing fluctuating power usage: I somehow managed to go down to 14mA, but now I’m back at ~75mA, not sure what’s causing it.

1 Like

Wow, what a great writeup! Inspired by your post, I did some more detailed testing.

I’m still seeing backwards behavior in that deep uses about 3x more than s2idle. Specifically I see about 25mA for s2idle and 75mA for deep. This is consistent across multiple tests for various durations of 2-10 hours. I’ve tried various changes like nvme.noacpi, initiating manually/automatically, disabling AX210 radio, nothing seems to make a signifcant difference.

I’m using a 12th Gen, BIOS 3.05, Debian Bookworm A1, Xfce, SN770 1TB.

No one else is seeing this backwards behavior? Maybe I have a bad build or BIOS?

2 Likes

What app is this?

Now that you mention it, I have just tried, and I actually can’t suspend to s2idle anymore, at least not if I printf deep > /sys/power/mem_sleep; the machine just doesn’t suspend at all!

Definitely something fishy going on here… sigh.

update: turns out doing the runtime change doesn’t work. rebooting with mem_sleep_default changed does work though.

i’m doing more thorough tests to analyze what is taking up power during standby now, stay tuned.

1 Like

It’s a Gnome extension called Vitals

5 Likes

Some more testing and it looks like my 2x USBA adapters may be the culprit. Removing them doesn’t affect s2idle much (still about 25mA) but deep is now 19mA. Less than s2idle and nowhere near the 75mA I was seeing. A very strange result but the only correlation I can find. I tried an NVMe firmware update, loading additional i915 firmware, etc. nothing affected deep until I removed the USBA adapters.

1 Like

Actually… back in April, you seemed to be saying that nvme.noacpi=1 had an effect only in s2idle (as opposed to deep) sleep mode, any update on that?

1 Like

I did that here:

It looks like s2idle vs deep doesn’t have as big of an effect as I thought it would, about 50mW difference. nvme.noacpi=1 shaves off only 10mW, possibly within the margin of errors of my measurements.

Still, 50mW, over the whole battery life, means two less days battery, so deep is definitely worth it for me.

1 Like

There are some news about upcoming enhancements in kernel too.

12 Likes

I’ve edited the wiki to reflect that disabling rdd is not only not required to get hardware decoding working, it actively reduces the security of the browser by disabling the sandbox.

5 Likes

Did someone notices worse battery performance with kernel 6.0.6 ?
The camera is sucking power even if not used according to powertop.
I checked if autosuspend was set, and it is.
Manually flipping the hardware switch to off fixes the issue.
But I didn’t have to do that in 6.0.5.

Edit: I rollbacked an old kernel and still have the issue, so it’s something else.
Edit2: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/2669

2 Likes

@IPGentlemann

I enabled the powertop service. It always shows the following:

$ sudo systemctl status powertop -l
○ powertop.service - Extend the battery life of laptop
     Loaded: loaded (/lib/systemd/system/powertop.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Wed 2022-11-02 17:39:20 CET; 2min 4s ago
    Process: 192272 ExecStart=/usr/sbin/powertop --auto-tune (code=exited, status=0/SUCCESS)
   Main PID: 192272 (code=exited, status=0/SUCCESS)
        CPU: 3.266s

Nov 02 17:39:15 lamy powertop[192272]: glob returned GLOB_ABORTED
Nov 02 17:39:18 lamy powertop[192272]: Leaving PowerTOP
Nov 02 17:39:20 lamy powertop[192272]: Cannot load from file /var/cache/powertop/saved_parameters.powertop
Nov 02 17:39:20 lamy powertop[192272]: File will be loaded after taking minimum number of measurement(s) with battery only
Nov 02 17:39:20 lamy powertop[192272]: Cannot load from file /var/cache/powertop/saved_parameters.powertop
Nov 02 17:39:20 lamy powertop[192272]: File will be loaded after taking minimum number of measurement(s) with battery only
Nov 02 17:39:20 lamy powertop[192272]: To show power estimates do 113 measurement(s) connected to battery only
Nov 02 17:39:20 lamy systemd[1]: powertop.service: Deactivated successfully.
Nov 02 17:39:20 lamy systemd[1]: Finished Extend the battery life of laptop.
Nov 02 17:39:20 lamy systemd[1]: powertop.service: Consumed 3.266s CPU time.

How can I find out if its working fine?

1 Like

Looks like you haven’t run powertop while on battery, it hasn’t written any metrics to those files yet. Once you do run powertop while on battery, those files will be created and they’ll store the parameters they are talking about.

The service just essentially runs powertop --autotune for you. You’ll know it worked if all the services under the tunables tab in powertop are reporting good.

1 Like

A bit late to the party but I noticed my 11th gen has considerably better battery once my VPN kill switch was enabled, I believe this is due to it disabling wifi on standby

1 Like

So, just for reference for folks. I installed the Linux-Clear kernel today. I also removed the redshift package, and with these changes, I dropped my average poweruse down to about 5.47 wh, with Bluetooth and wifi active. I don’t know what that Intel kernel has going for it, but this has been a reduction of power use by about 30% for me.

4 Likes

I am not running any sort of power config and my i5-1240p is running amazingly.

While comparing and swapping between Fedora’s power-profiles-daemon and TLP I found that running the machine without either of them gets me exactly what I want. I get 3-4W idles and reach C10 easily. I average 5-7W when browsing. I get a .50-.60 percent battery drain per hour with the lid shut. 2D games run at about 10W average, and Portal 2 averages 16W at native res (AA disabled). If I want to run something demanding like modded minecraft, I can still get the processor cooking at about 45+ W with feral gamemode.

Is there something I’m missing here? I checked systemctl and confirmed TDP is uninstalled and PPD is disabled. It feels like I’m running a very good power manager but I definitely am not.

2 Likes

My Setup:

  • 12th gen 1240P, 32GB Ram (2x16GB), Intel Corporation Wi-Fi 6 AX210/AX211/AX411 160MHz (rev 1a)
  • WD_BLACK SN770 1TB (731100WD)
  • BIOS 03.06
  • Linux 6.1.3
  • 2 USB C, 1 HDMI, 1 USB 2, all disconnected
  • Grub: GRUB_CMDLINE_LINUX_DEFAULT="loglevel=4 pcie_aspm=off nvme_core.default_ps_max_latency_us=0 nvme.noacpi=1 mem_sleep_default=deep"

My Results:

17% usage in 10 hours. I think 1,7% drain within 10 hours is within the expected range?

2 Likes

@Miguel_Parra I don’t think you are missing anything. Newer processors are very good at managing their power. The primary reason to use TLP is to disable turbo boost on battery and to model behavior for Bluetooth, docks, drives, etc. Power profiles does not offer this which is why it does not even enter the picture for me.

1 Like