Systemd uses CPU after wakeup due to power_supply BAT0 (battery) continued polling
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OEM Priority Project |
Fix Committed
|
Critical
|
Unassigned | ||
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
My setup:
- Dell Latitude 7520
- Dell WD15 USB C docking station
- Ubuntu 20.04.3
- systemd 245.4-4ubuntu3.13
- uname -a:
Linux CLIFMI085 5.13.0-1012-oem #16-Ubuntu SMP Tue Sep 7 09:23:08 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
I leave my laptop docked and, after waking it up from sleep, the fans start blowing. After a quick inspection with top/htop, I always see /usr/lib/
After a quick search, I discover that I can use `udevadm monitor` to check what device is making all this fuss, and this is the output:
UDEV [92591.827159] change /devices/
UDEV [92591.873819] change /devices/
UDEV [92591.920022] change /devices/
UDEV [92591.967005] change /devices/
UDEV [92592.018200] change /devices/
UDEV [92592.068351] change /devices/
UDEV [92592.115100] change /devices/
UDEV [92592.166201] change /devices/
UDEV [92592.213318] change /devices/
UDEV [92592.261046] change /devices/
UDEV [92592.308824] change /devices/
UDEV [92592.356577] change /devices/
UDEV [92592.403766] change /devices/
UDEV [92592.451164] change /devices/
As you can see, the battery status is being polled every 0.05s. To fix this, I just need to restart the service with:
sudo systemctl restart systemd-udevd systemd-
Afterwards, this is the output of `udevadm monitor`:
KERNEL[
UDEV [92739.646888] change /devices/
KERNEL[
UDEV [92741.099370] change /devices/
KERNEL[
UDEV [92742.573812] change /devices/
As you can see, the battery is now being polled every ~1.5s, which is fine.
tags: | added: fossa-squirtle |
tags: | added: oem-priority |
Changed in oem-priority: | |
importance: | Undecided → Critical |
Changed in oem-priority: | |
status: | New → Fix Committed |
Changed in systemd (Ubuntu): | |
status: | Confirmed → Invalid |
Status changed to 'Confirmed' because the bug affects multiple users.