[mako] upower consuming over 17% cpu when in idle

Bug #1420395 reported by Pat McGowan
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Incomplete
Low
Canonical Phone Foundations
upower (Ubuntu)
Confirmed
Low
Ricardo Salveti

Bug Description

From the meta battery bug # 1372413
mako running 191

As device was not suspending and battery level running down, upower is reported at 17%+ cpu by the cpustat tool
 mpdecision and systemd-udevd also change their behavior.

The upower cpu consumption is just a side effect of the amount of battery related events the kernel send, and specific to mako.

Tags: power-bugs
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :
tags: added: battery
Changed in upower (Ubuntu):
status: New → Confirmed
Changed in canonical-devices-system-image:
status: New → Confirmed
importance: Undecided → High
milestone: none → ww11-2015
Changed in upower (Ubuntu):
assignee: nobody → Ricardo Salveti (rsalveti)
Changed in canonical-devices-system-image:
assignee: nobody → Ricardo Salveti (rsalveti)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

It seems the problem relies more on the kernel side and with the amount of events the battery driver sends to the userspace (even when there is no change).

udevadm monitor is already enough to show the amount of kernel events the battery driver sends to the userspace.

Revision history for this message
Ricardo Salveti (rsalveti) wrote :
Download full text (8.3 KiB)

As an example, the amount of upower events when connecting/disconnecting the usb cable (charger) on mako:
root@ubuntu-phablet:/sys# upower -m
Monitoring activity from the power daemon. Press Ctrl+C to cancel.
[03:54:38.613] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.616] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.620] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.621] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.621] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.622] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.624] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.632] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.633] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.634] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.636] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:38.636] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.122] device changed: /org/freedesktop/UPower/devices/line_power_pm8921_dc
[03:54:39.128] device changed: /org/freedesktop/UPower/devices/line_power_pm8921_dc
[03:54:39.129] device changed: /org/freedesktop/UPower/devices/line_power_pm8921_dc
[03:54:39.129] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.130] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.131] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.131] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.131] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.132] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.132] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.133] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.133] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.134] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.134] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.143] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.144] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.144] daemon changed:
[03:54:39.427] device changed: /org/freedesktop/UPower/devices/line_power_pm8921_dc
[03:54:39.427] device changed: /org/freedesktop/UPower/devices/line_power_pm8921_dc
[03:54:39.428] device changed: /org/freedesktop/UPower/devices/line_power_pm8921_dc
[03:54:39.430] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.431] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.432] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.432] device changed: /org/freedesktop/UPower/devices/battery_battery
[03:54:39.433] device cha...

Read more...

Changed in canonical-devices-system-image:
milestone: ww11-2015 → ww13-ota
Changed in canonical-devices-system-image:
milestone: ww11-ota → ww13-ota
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

After profiling upower, this is actually not an issue in there, as the only thing it is doing is getting the battery change event from the kernel, updating the internal struct and sending another dbus message so the clients could see the changes.

The main issue here is that the kernel is sending a big amount of battery events (all valid, and different changes), which results in udev, upower and dbus consuming a bit of your cpu.

Verified this bug against both krillin and arale and that is not the case there, as I already did the profiling and reduced the amount of battery events.

As this bug is just specific to mako, and would require a kernel change to reduce the amount of events, we can lower the priority and fix in vivid only.

summary: - upower consuming over 17% cpu
+ [mako] upower consuming over 17% cpu when in idle
description: updated
Changed in canonical-devices-system-image:
milestone: ww13-ota → ww15-2015
Changed in canonical-devices-system-image:
importance: High → Low
Changed in upower (Ubuntu):
importance: High → Low
Changed in canonical-devices-system-image:
milestone: ww15-2015 → ww17-2015
Changed in canonical-devices-system-image:
assignee: Ricardo Salveti (rsalveti) → Canonical Phone Foundations (canonical-phonedations-team)
Changed in canonical-devices-system-image:
milestone: ww17-2015 → ww21-2015
Changed in canonical-devices-system-image:
milestone: ww21-2015 → none
Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

not seen in some time

tags: added: power-bugs
removed: battery
Changed in canonical-devices-system-image:
status: Confirmed → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.