fwupd / fwupd

A system daemon to allow session software to update firmware
GNU Lesser General Public License v2.1
2.92k stars 437 forks source link

Is fwupd eating m battery? #288

Closed godiard closed 6 years ago

godiard commented 7 years ago

Powertop reports:

PowerTOP v2.9     Overview   Idle stats   Frequency stats   Device stats   Tunables                                     

The battery reports a discharge rate of 11.7 W
The power consumed was 231 J
The estimated remaining time is 3 hours, 53 minutes

Summary: 752,5 wakeups/second,  0,0 GPU ops/seconds, 0,0 VFS ops/sec and 14,2% CPU use

Power est.              Usage       Events/s    Category       Description
  7.59 W     26,4 µs/s       0,5        Process        [PID 2905] /usr/libexec/fwupd/fwupd
  2.89 W     10,0%                      Device         Display backlight
  1.12 W      0,0 pkts/s                Device         nic:virbr0
  172 mW      5,3 ms/s     225,9        Interrupt      PS/2 Touchpad / Keyboard / Mouse
  102 mW     26,9 ms/s     129,3        Process        [PID 24055] /opt/google/chrome/chrome --type=renderer --field-trial-handle=1578705589192891195,61639737
 76.5 mW    100,0%                      Device         Radio device: ideapad_acpi
 51.5 mW     36,9 ms/s      61,0        Process        [PID 2273] /usr/bin/gnome-shell
 38.2 mW      2,9 pkts/s                Device         Network interface: wlp2s0 (iwlwifi)
 37.7 mW     14,1 ms/s      47,1        Process        [PID 23579] /opt/google/chrome/chrome --type=gpu-process --field-trial-handle=1578705589192891195,61639
 37.6 mW      4,6 ms/s      48,8        Process        [PID 23503] /opt/google/chrome/chrome
 37.4 mW      3,3 ms/s      48,8        Process        [PID 2280] /usr/bin/Xwayland :0 -rootless -noreset -listen 4 -listen 5 -displayfd 6
 29.5 mW      8,7 ms/s      37,3        Process        [PID 23469] /opt/google/chrome/chrome
 15.7 mW    224,2 µs/s      20,7        Process        [PID 8] [rcu_sched]
 11.6 mW    150,3 µs/s      15,3        Process        [PID 844] /sbin/rngd -f
 10.1 mW    610,2 µs/s      13,2        Process        [PID 2298] /usr/libexec/at-spi2-registryd --use-gnome-session
 6.97 mW      3,5 ms/s       8,5        Process        [PID 23748] /opt/google/chrome/chrome --type=renderer --field-trial-handle=1578705589192891195,61639737
 6.41 mW    647,7 µs/s       8,3        Timer          hrtimer_wakeup
 6.25 mW      2,1 ms/s       7,9        Process        [PID 23894] /opt/google/chrome/chrome --type=renderer --field-trial-handle=1578705589192891195,61639737
 4.80 mW      3,5 ms/s       5,7        Interrupt      [7] sched(softirq)
 4.68 mW      3,2 ms/s       5,6        Process        [PID 24682] /opt/google/chrome/chrome --type=renderer --field-trial-handle=1578705589192891195,61639737
 4.22 mW    224,4 µs/s       5,5        Process        [PID 404] [i915/signal:0]
 4.19 mW     10,3 ms/s       3,6        Process        [PID 18503] /usr/libexec/gnome-terminal-server
 3.80 mW      1,2 ms/s       4,8        Timer          tick_sched_timer
 3.01 mW     95,1 µs/s       4,0        kWork          gc_worker
 2.90 mW    116,6 µs/s       3,8        Process        [PID 29] [rcuos/2]
 2.74 mW    117,8 µs/s       3,6        Process        [PID 61] [rcuos/6]
 2.38 mW     52,8 µs/s       3,1        Process        [PID 45] [rcuos/4]

I don't know is this is useful but strace reports:

[gonzalo@localhost ~]$ ps ax | grep fw
 2905 ?        Ssl    0:01 /usr/libexec/fwupd/fwupd

[gonzalo@localhost ~]$ sudo strace -p  2905
strace: Process 2905 attached
restart_syscall(<... resuming interrupted poll ...>) = 0
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)
poll([{fd=3, events=POLLIN}, {fd=13, events=POLLIN}, {fd=14, events=POLLIN}], 3, 5000) = 0 (Timeout)

forever...

$ fwupdgmr --version
client version: 0.9.6
daemon version: 0.9.6
compile-time dependency versions
    appstream-glib: 0.7.0
    gusb:   0.2.11
$ fwupdmgr get-devices
Lenovo EasyCamera
  DeviceID:             usb:00:01
  Guid:                 52b7aac8-b30f-5bf6-a08a-4c6297b22cba
  Guid:                 6a556b64-3a3a-5dde-9bc8-cde64045d37a
  Plugin:               usb
  Flags:                none
  DeviceVendorId:       USB:0x174F
  Version:              8.39
  Created:              2017-10-05

4th Gen Core Processor Integrated Graphics Controller
  DeviceID:             ro__sys_devices_pci0000_00_0000_00_02_0
  Guid:                 36a2c279-d81b-5ae9-81fb-e85620143cbd
  Plugin:               udev
  Flags:                internal
  DeviceVendor:         Intel Corporation
  DeviceVendorId:       PCI:0x8086
  Created:              2017-10-05
$ efibootmgr -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,2003,2001,2002
Boot0000* EFI Network 0 for IPv4 (28-D2-44-70-46-F3)    PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(28d2447046f3,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)RC
Boot0002* EFI Network 0 for IPv6 (28-D2-44-70-46-F3)    PciRoot(0x0)/Pci(0x1c,0x0)/Pci(0x0,0x0)/MAC(28d2447046f3,0)/IPv6([::]:<->[::]:,0,0)RC
Boot0003* Fedora    HD(1,GPT,d9f9a495-e544-4e04-806f-0339f0ed819e,0x800,0x64000)/File(\EFI\fedora\shim.efi)
Boot2001* EFI USB Device    RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC
$ efivar -l | grep fw
$ tree /boot
/boot
├── config-3.13.10-200.fc20.x86_64
├── config-3.14.2-200.fc20.x86_64
├── config-4.11.11-300.fc26.x86_64
├── config-4.11.12-200.fc25.x86_64
├── config-4.12.9-300.fc26.x86_64
├── efi [error opening dir]
├── elf-memtest86+-5.01
├── extlinux
│   ├── cat.c32
│   ├── chain.c32
│   ├── cmd.c32
│   ├── cmenu.c32
│   ├── config.c32
│   ├── cptime.c32
│   ├── cpu.c32
│   ├── cpuid.c32
│   ├── cpuidtest.c32
│   ├── debug.c32
│   ├── dhcp.c32
│   ├── dir.c32
│   ├── disk.c32
│   ├── dmi.c32
│   ├── dmitest.c32
│   ├── elf.c32
│   ├── ethersel.c32
│   ├── gfxboot.c32
│   ├── gpxecmd.c32
│   ├── hdt.c32
│   ├── hexdump.c32
│   ├── host.c32
│   ├── ifcpu64.c32
│   ├── ifcpu.c32
│   ├── ifmemdsk.c32
│   ├── ifplop.c32
│   ├── kbdmap.c32
│   ├── kontron_wdt.c32
│   ├── ldlinux.c32
│   ├── lfs.c32
│   ├── libcom32.c32
│   ├── libgpl.c32
│   ├── liblua.c32
│   ├── libmenu.c32
│   ├── libutil.c32
│   ├── linux.c32
│   ├── ls.c32
│   ├── lua.c32
│   ├── mboot.c32
│   ├── memdisk
│   ├── meminfo.c32
│   ├── menu.c32
│   ├── pci.c32
│   ├── pcitest.c32
│   ├── pmload.c32
│   ├── poweroff.c32
│   ├── prdhcp.c32
│   ├── pwd.c32
│   ├── pxechn.c32
│   ├── reboot.c32
│   ├── rosh.c32
│   ├── sanboot.c32
│   ├── sdi.c32
│   ├── sysdump.c32
│   ├── syslinux.c32
│   ├── vesa.c32
│   ├── vesainfo.c32
│   ├── vesamenu.c32
│   ├── vpdtest.c32
│   ├── whichsys.c32
│   └── zzjson.c32
├── grub2
│   ├── grub.cfg
│   ├── grubenv -> /boot/efi/EFI/fedora/grubenv
│   └── themes
│       └── system
│           ├── background.png
│           └── fireworks.png
├── initramfs-0-rescue-23f095bf6b6a45739f404fc6a9a3b6ce.img
├── initramfs-0-rescue-73590d38f502410a901c015a9939266d.img
├── initramfs-3.13.10-200.fc20.x86_64.img
├── initramfs-3.14.2-200.fc20.x86_64.img
├── initramfs-4.11.11-300.fc26.x86_64.img
├── initramfs-4.11.12-200.fc25.x86_64.img
├── initramfs-4.12.9-300.fc26.x86_64.img
├── initrd-plymouth.img
├── lost+found [error opening dir]
├── memtest86+-5.01
├── System.map-3.13.10-200.fc20.x86_64
├── System.map-3.14.2-200.fc20.x86_64
├── System.map-4.11.11-300.fc26.x86_64
├── System.map-4.11.12-200.fc25.x86_64
├── System.map-4.12.9-300.fc26.x86_64
├── vmlinuz-0-rescue-23f095bf6b6a45739f404fc6a9a3b6ce
├── vmlinuz-0-rescue-73590d38f502410a901c015a9939266d
├── vmlinuz-3.13.10-200.fc20.x86_64
├── vmlinuz-3.14.2-200.fc20.x86_64
├── vmlinuz-4.11.11-300.fc26.x86_64
├── vmlinuz-4.11.12-200.fc25.x86_64
└── vmlinuz-4.12.9-300.fc26.x86_64

Please answer the following questions:


I hope this is useful in some way. Will try reboot and check if happen again.
godiard commented 7 years ago

After reboot, again:

PowerTOP v2.9     Overview   Idle stats   Frequency stats   Device stats   Tunables                                     

The battery reports a discharge rate of 15.6 W
The power consumed was 0.00 J
The estimated remaining time is 2 hours, 33 minutes

Summary: 655,6 wakeups/second,  0,0 GPU ops/seconds, 0,0 VFS ops/sec and 3,8% CPU use

Power est.              Usage       Events/s    Category       Description
  8.78 W     23,2 µs/s      0,00        Process        [PID 2954] /usr/libexec/fwupd/fwupd
  2.00 W      0,0 pkts/s                Device         nic:virbr0
  1.80 W     10,0%                      Device         Display backlight
  197 mW     20,5 ms/s     385,7        Process        [PID 2761] /usr/libexec/tracker-miner-fs
 32.9 mW      1,0 ms/s      64,8        Interrupt      [4] block(softirq)
 15.9 mW    100,6 µs/s      31,4        Process        [PID 8] [rcu_sched]
 14.4 mW     14,9 µs/s      28,5        kWork          cfq_kick_queue
 10.4 mW     95,7 µs/s      20,6        Process        [PID 865] /sbin/rngd -f
 6.02 mW      1,0 pkts/s                Device         Network interface: wlp2s0 (iwlwifi)
 5.97 mW    157,5 µs/s      11,8        Timer          hrtimer_wakeup
 5.96 mW     31,6 µs/s      11,8        Process        [PID 10] [rcuos/0]
 5.72 mW      7,6 ms/s       9,8        Process        [PID 2270] /usr/bin/gnome-shell
 5.22 mW      2,5 ms/s       9,8        Process        [PID 2946] /usr/libexec/gnome-terminal-server
 4.99 mW    300,6 µs/s       9,8        Timer          tick_sched_timer
 4.47 mW     62,5 µs/s       8,8        kWork          gc_worker
 3.50 mW    228,9 µs/s       6,9        Interrupt      [28] i915
 3.48 mW     32,7 µs/s       6,9        Process        [PID 29] [rcuos/2]
 2.49 mW     95,1 µs/s       4,9        Process        [PID 643] [irq/30-iwlwifi]
 2.04 mW    544,8 µs/s       3,9        Process        [PID 2686] /usr/sbin/cupsd -l
 1.50 mW     85,3 µs/s       2,9        Process        [PID 407] [i915/signal:0]
 1.49 mW     55,4 µs/s       2,9        kWork          i915_gem_idle_work_handler
 1.49 mW      1,7 µs/s       2,9        kWork          blk_delay_work
 1.07 mW      0,8 ms/s       2,0        Interrupt      [7] sched(softirq)
 1.00 mW    125,2 µs/s       2,0        Process        [PID 3484] pool
 999 µW      65,7 µs/s       2,0        Process        [PID 1531] /usr/libexec/gsd-color
 993 µW       2,9 µs/s       2,0        kWork          intel_atomic_helper_free_state_
 992 µW       0,0 µs/s       2,0        kWork          intel_atomic_commit_work
 516 µW     195,5 µs/s       1,0        Process        [PID 3505] powertop
 508 µW     120,1 µs/s       1,0        Process        [PID 429] [jbd2/sda4-8]
 503 µW      64,1 µs/s       1,0        Process        [PID 3486] pool
 502 µW      60,4 µs/s       1,0        Process        [PID 1049] /usr/bin/python -Es /usr/sbin/tuned -l -P

Tell me if you need more information

hughsie commented 7 years ago

Powertop uses a pretty broken heuristic, 8.78W is clearly insane. That said, we did fix a bug to avoid opening lots of devices, so if you could try 1.0.0 and tell me if it's fixed then I'll know I need to backport the FuDeviceLocker patches back to 0.9.*

godiard commented 7 years ago

I have installed fwupd 1.0.0 from rawhide (I needed uninstall gnome-software) and fwupd does not appear anymore in powertop list. Consume was reduced, but I don't know if the deamon is running right now.

How can I be sure?

PowerTOP v2.9     Overview   Idle stats   Frequency stats   Device stats   Tunables                                     

The battery reports a discharge rate of 8.40 W
The power consumed was 190 J
The estimated remaining time is 4 hours, 27 minutes

Summary: 543,2 wakeups/second,  0,0 GPU ops/seconds, 0,0 VFS ops/sec and 10,5% CPU use

Power est.              Usage       Events/s    Category       Description
  3.66 W      0,0 pkts/s                Device         nic:virbr0
  2.40 W     10,0%                      Device         Display backlight
  1.36 W      2,1 pkts/s                Device         Network interface: wlp2s0 (iwlwifi)
  972 mW    100,0%                      Device         Radio device: ideapad_acpi
  270 mW     14,2 ms/s      99,2        Process        [PID 3596] /opt/google/chrome/chrome
  153 mW     24,1 ms/s      54,3        Process        [PID 3759] /opt/google/chrome/chrome --type=renderer --field-trial-handle=16515333486807966487,55470936
  126 mW      5,1 ms/s      46,7        Process        [PID 3813] /opt/google/chrome/chrome --type=renderer --field-trial-handle=16515333486807966487,55470936
  109 mW      9,0 ms/s      39,7        Process        [PID 3711] /opt/google/chrome/chrome --type=gpu-process --field-trial-handle=16515333486807966487,55470
 95.1 mW      0,0 pkts/s                Device         Network interface: enp1s0 (alx)
 95.0 mW      2,7 ms/s      35,2        Process        [PID 3761] /opt/google/chrome/chrome --type=renderer --field-trial-handle=16515333486807966487,55470936
 91.7 mW    583,3 µs/s      34,2        Interrupt      PS/2 Touchpad / Keyboard / Mouse
 87.9 mW      2,0 ms/s      32,6        Process        [PID 2255] /usr/bin/Xwayland :0 -rootless -noreset -listen 4 -listen 5 -displayfd 6
 68.9 mW    258,4 µs/s      25,8        Process        [PID 9] [rcu_sched]
 62.2 mW     11,3 ms/s      21,8        Process        [PID 2248] /usr/bin/gnome-shell
 36.7 mW      1,0 ms/s      13,6        Timer          hrtimer_wakeup
 35.8 mW      4,7 ms/s      12,8        Process        [PID 4146] /opt/google/chrome/chrome --type=renderer --field-trial-handle=16515333486807966487,55470936
 26.3 mW      4,0 ms/s       9,3        Process        [PID 3952] /opt/google/chrome/chrome --type=renderer --field-trial-handle=16515333486807966487,55470936
hughsie commented 7 years ago

Either fwupdmgr get-devices or ps aux | grep fwupd

godiard commented 7 years ago

Ok, running :)

Maybe you shoould backport that changes!

hughsie commented 6 years ago

Backporting this is a large change. I'd like to get some more testing of 1.0.0 before doing a smaller backport.

godiard commented 6 years ago

No problem, let me know if I can help with any data. Thanks for all your work! (big Fedora fun here)