Fedora battery life vs voidlinux - crazy wifi?

Can someone help me figure out why I’m getting significantly worse battery life on Fedora-38 compared to Void Linux, even though my setup and workload appear to be identical? Both systems use the same screen brightness, CPU governor, and hardware, but Fedora’s WiFi seems to be draining power unusually fast. I’ve tried enabling power save mode for WiFi with iw, but it hasn’t made a noticeable difference. Any insights or suggestions?

fedora powertop:

The battery reports a discharge rate of 23.5 W
The energy consumed was 0.00 J
System baseline power is estimated at 23.9 W

Power est.    Usage     Device name
  21.9 W      9.8 pkts/s  Network interface: wlp3s0 (iwlwifi)
  1.01 W     13.0%        CPU core
  785 mW    100.0%        Audio codec hwC0D0: Realtek (pipewire )
  214 mW      0.0 pkts/s  Network interface: enp6s0 (r8169)
    0 mW    100.0%        Radio device: btusb

voidlinux powertop:

The battery reports a discharge rate of 13.9 W
The energy consumed was 643 J
System baseline power is estimated at 18.6 W

Power est.    Usage     Device name
              0.0 pkts/s  Network interface: enp6s0 (r8169)
  6.61 W      6.0 pkts/s  Network interface: wlp3s0 (iwlwifi)
  1.00 W     15.8%        CPU core
  910 mW     15.8%        CPU misc
  116 mW    100.0%        Radio device: btusb
    0 mW    100.0%        Radio device: iwlwifi

wifi hardware is “Intel Corporation Centrino Wireless-N 1030 [Rainbow Peak] (rev 34)”

Battery life on Void is almost double that on Fedora.

EDIT More details on the setup: it’s the LXDE spin but with sway in use.

In my testing, the only things running are a single foot instance and an inactive syncthing process. No browser, no word processor. Application (CPU) load and network load is almost zero. No swapping. On fedora there is slightly more IO, mainly due to systemd-journald and other systemd processes. Also jbd2 (the ext4 journalling layer - probably because of the systemd activity).

The hardware is an old Dell XPS L502X (delivered 10/8/2011)

1920x1080 15.6" 39.6cm
4Gb upgraded to 8Gb
DVD replaced by 256Gb SSD

The wifi driver is the same on each OS:

iwlwifi 0000:03:00.0: loaded firmware version 18.168.6.1 6000g2b-6.ucode op_mode iwldvm  

Another data point - if I turn off the wifi (Fn-f2 on this laptop), fedora goes from about 1h of battery life to 1h 20m so the wifi hardware is not the whole story (void gives 2h battery life increasing to 2h 30m with the wifi off).

In summary, the only significant difference in the 2 environments is that systemd keeps fedora slightly busy all the time. Could that be enough to burn the battery?

1 Like

It relly depends on the drivers you are using and also what the kernel you are using.

Unfortunately hardware drivers are mostly still closed sources. So that you can compare correctly you would have to check what exactly each OS uses. You would like to check the same kernel with the same drivers as void os uses.

A good place to check if compatibility is same check on http://linux-hardware.org/ if you have listings for both os’es.

Both systems run the same version of the iwlwifi driver. From dmesg:

iwlwifi 0000:03:00.0: loaded firmware version 18.168.6.1 6000g2b-6.ucode op_mode iwldvm

One difference is that fedora is compiled with:

[   15.661685] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG enabled
[   15.661690] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
[   15.661692] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled

However, /sys/module/iwlwifi/parameters/debug contains 0 - so debugging is turned off.

Also, if I turn off the wifi (Fn-f2 on this laptop), fedora goes from about 1h of battery life to 1h 20m so the wifi hardware is not the whole story (void gives 2h battery life increasing to 2h 30m with the wifi off).

Please tell us what exactly you are comparing. Void comes with xfce or without DE?

On some Screenshots I also see Mate desktop. Which spin alias workstation are you using with Fedora?

This tells us that wifi is far from the whole story. Look at everything, not just wifi.
On void wifi appears to use ~20% of the battery life (120 min/150 min = 80%) (30 minutes) and on fedora wifi appears to use only about 25% of the battery life (80 min / 60 min = 75%) (20 minutes). With fedora that may appear to be much more, but in reality the difference is comparable.

We do not know the age of the laptop & battery, nor the expected battery life, nor the actual workload with either distro.

@L.S. - Umm - I didn’t do any screenshots, I think you’re looking at something else. But thanks for taking the time to look at this - I’ve added a few more details to the original post. On both fedora and void, I’m testing with a very stripped down desktop using sway+waybar and a single foot terminal. syncthing is running (but passive). The original spin used on fedora was LXDE (but many years ago).

1 Like

sounds reasonable, thanks … I’ve added more detail to the original post. I’m kinda sorta pointing the bone at systemd (without wanting to get into flame wars on that taboo!)

1 Like

I generally think of Fedora as slow and heavily instrumented, Void as fast and light. Your experiment looks interesting.

How much mass storage space does each system use? Are there significant differences in RAM usage running the same tasks? Do the two systems use the same filesystems?

I assume btrfs goodness comes at a cost. Maybe sar or iostat will provide useful comparisons.

It could also be useful to compare kernel configurations and compiler options. There has been coverage of performance cost of mitigations for insecurity mitigations – I expect there are power costs as well.

1 Like

Interesting points! I haven’t done anything special with mitigations, but other than that, I’ll have to do some research into them. You could well be onto something there.

The file system is ext4, not btrfs.

iostat shows almost no activity on both systems, just a little systemd* and jbd2 on fedora. Void doesn’t even move the needle.

I have a lot of -devel packages and compilers etc installed, so disc space is a bit meaningless. I’ve used 12Gb on void. Both systems use the same, shared home file system.

WRONG In fact, void seems to have more mitigations turned on than fedora: WRONG

$ grep MITIGA /mnt/fedora-boot/config-6.4.12-200.fc38.x86_64
CONFIG_SPECULATION_MITIGATIONS=y
# CONFIG_GDS_FORCE_MITIGATION is not set
# CONFIG_RESET_ATTACK_MITIGATION is not set
0 14:11 2023/ 
$ grep MITIGA /boot/config-6.3.13_1
CONFIG_SPECULATION_MITIGATIONS=y
CONFIG_RESET_ATTACK_MITIGATION=y

Quite possibly I’m not searching thoroughly enough

EDIT these are the mitigations in use in voidlinux:

# dmesg | grep -i mitigation
[    0.122183] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.122266] Spectre V2 : Mitigation: Retpolines
[    0.122327] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.122598] MMIO Stale Data: Unknown: No mitigations

I think kernel config does not always have MITIGATION in the names. Here, with 6.4.15-200.fc38.x86_64:

% dmesg | grep -i mitiga
[    0.103626] Spectre V1 : Mitigation: usercopy/swapgs barriers and __user pointer sanitization
[    0.103630] Spectre V2 : Mitigation: IBRS
[    0.103632] Spectre V2 : Spectre v2 / SpectreRSB mitigation: Filling RSB on context switch
[    0.103638] RETBleed: Mitigation: IBRS
[    0.103640] Spectre V2 : mitigation: Enabling conditional Indirect Branch Prediction Barrier
[    0.103644] Speculative Store Bypass: Mitigation: Speculative Store Bypass disabled via prctl
[    0.103653] MDS: Mitigation: Clear CPU buffers
[    0.103656] TAA: Mitigation: TSX disabled
[    0.103658] MMIO Stale Data: Mitigation: Clear CPU buffers
[    0.103663] SRBDS: Mitigation: Microcode
[    0.103671] GDS: Mitigation: Microcode

I get the same list with journalctl -b -g '[mM]itiga'.

Interesting. More mitigations = less performance but I have not seen them blamed for battery leaching so far.