ActivityIndicators cause very high cpu usage for unity8/mir even when visible: false

Bug #1513450 reported by kevin gunn on 2015-11-05
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Pocket Desktop
Critical
kevin gunn
Canonical System Image
Critical
kevin gunn
Mir
Invalid
Critical
Alberto Aguirre
Online Accounts setup for Ubuntu Touch
Undecided
Unassigned
ubuntu-system-settings (Ubuntu)
Critical
Unassigned
ubuntu-ui-toolkit (Ubuntu RTM)
Critical
Christian Dywan

Bug Description

running in window mode, open u-s-s, run top
unity8 running at ~40% cpu on N7 cpu freq ~1GHz

no monitor attached

note: testing with silo 18 of mir containing lp:~albaguirre/mir/fix-1499039 (equivalent for 0.17)

Related branches

kevin gunn (kgunn72) on 2015-11-05
description: updated
Changed in canonical-pocket-desktop:
assignee: nobody → kevin gunn (kgunn72)
Changed in unity8 (Ubuntu):
importance: Undecided → High
Changed in canonical-pocket-desktop:
importance: Undecided → High
kevin gunn (kgunn72) on 2015-11-05
Changed in canonical-pocket-desktop:
importance: High → Critical
Changed in unity8 (Ubuntu):
importance: High → Critical
Michael Zanetti (mzanetti) wrote :

Some observations:

* For me, this happens only when the Bluetooth page in systemsettings is opened.
* Doesn't matter if windowed or staged mode
* Happens on all devices

turns out the Bluetooth Page in systemsettings is animating 3 ActivityIndicators even when they are not visible.

Not sure how that causes unity8's CPU usage to be that high, but the linked ubuntu-system-settings branch improves the situation a lot.

However, given that the ActivityIndicators are invisible, we probably should investigate why they keep on triggering rendering updates.

Adding ubuntu-system-settings, qtmir and qtubuntu.

Michael Zanetti (mzanetti) wrote :

Perhaps the UITK should be added to. The ActivityIndicator should not calculate the animations all the when visible is false.

Marking unity8 as invalid as this is what it takes to constantly render an animated app surface. It might be improved in QtMir, but not much that unity8 can do about it.

Changed in unity8 (Ubuntu):
status: New → Invalid
Gerry Boland (gerboland) wrote :

Testing mir_demo_server_minimal with mir_demo_client_egltriangle, I'm seeing 30% CPU usage by the mir server just drawing a single spinny triangle.

Testing a simple QML demo shell, we get same CPU usage as mir. So punting to Mir team for investigation.

kevin gunn (kgunn72) on 2015-11-05
Changed in mir:
importance: Undecided → Critical
kevin gunn (kgunn72) on 2015-11-05
description: updated
description: updated
summary: - higher than expected cpu for unity8
+ ActivityIndicators cause very high cpu usage for unity8/mir even when
+ visible: false
Changed in mir:
assignee: nobody → Alberto Aguirre (albaguirre)
status: New → In Progress
Alberto Aguirre (albaguirre) wrote :

Nexus 4 perf flamegraph, 1 mir_demo_server, 5 mir_demo_client_egltriangle instances

Changed in ubuntu-system-settings (Ubuntu):
importance: Undecided → Critical
Changed in canonical-devices-system-image:
assignee: nobody → kevin gunn (kgunn72)
importance: Undecided → Critical
milestone: none → ww02-2016
status: New → In Progress
Alberto Aguirre (albaguirre) wrote :

I'm trying to get perf to return a more complete picture, but from the attached flame graph (one mir_demo_server, one mir_demo_client_egltriangle in Nexus 4):

Of the time spent in mir (29%) roughly 50-60% of that is spent in the driver/kernel code (related to gpu/display)

Changed in ubuntu-system-settings (Ubuntu):
status: New → In Progress
kevin gunn (kgunn72) wrote :

@Alberto - so last week we were pretty well focused on n4 & n7when i logged this bug. Which are both code aurora afiak, so I'm wondering if we're chasing a gpu specific issues. maybe it's worth a quick check on mx4 or bq devices for comparison.

Alberto Aguirre (albaguirre) wrote :

Also worth noting that the 40% figure is with the default "ondemand" governor, which changes cpu clock "ondemand" and can potentially also change gpu clocks.

Using the "performance" governor (which fixes the cpu clock and potentially the gpu clock) the figure is closer to 10% cpu load on an N7.

On a vegetahd, with the default cpu governor, the server cpu load is around 20%. With the performance governor, the cpu load is around 11%.

Alberto Aguirre (albaguirre) wrote :

Looking at callgrind output on the desktop, there are no obvious mir hotspots we could single out and optimize. It's similar to the output of perf, in that quite a bit time is just spent in the GL + dri driver code.

One more point, using the interactive governor (which we should be defaulting to anyway) the N4 cpu usage reported by top is around 23%.

kevin gunn (kgunn72) on 2015-11-16
no longer affects: qtmir
no longer affects: unity8 (Ubuntu)
Changed in mir:
status: In Progress → Invalid
Changed in linux-flo (Ubuntu):
importance: Undecided → Critical
Changed in linux-mako (Ubuntu):
importance: Undecided → Critical
kevin gunn (kgunn72) wrote :

adding projects linux-mako & linux-flo, is it possible to change to the interactive governor by default (instead of OnDemand)

also, not just for mako/flo but this is a question that should be asked/answered for all devices (arale, krillin,... as well)

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in linux-flo (Ubuntu):
status: New → Confirmed
Changed in linux-mako (Ubuntu):
status: New → Confirmed
Zsombor Egri (zsombi) on 2015-11-17
affects: ubuntu-ui-toolkit → ubuntu-ui-toolkit (Ubuntu)
Changed in ubuntu-ui-toolkit (Ubuntu):
assignee: nobody → Christian Dywan (kalikiana)
importance: Undecided → Critical
status: New → In Progress
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-system-settings - 0.3+16.04.20151110-0ubuntu1

---------------
ubuntu-system-settings (0.3+16.04.20151110-0ubuntu1) xenial; urgency=medium

  [ Alejandro J. Cura ]
  * If a system package gets updated by the user, only show the user's
    copy (LP: #1265250)

  [ Bartosz Kosiorek ]
  * Allow translating "Unavailable" string (LP: #1511384) (LP: #1511384)

  [ Ken VanDine ]
  * Don't check for updates if not online (LP: #1505663)

  [ Michael Zanetti ]
  * Only animate ActivityIndicators when they are visible (LP: #1513450)

 -- Ken VanDine <email address hidden> Tue, 10 Nov 2015 15:27:33 +0000

Changed in ubuntu-system-settings (Ubuntu):
status: In Progress → Fix Released
Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Released
kevin gunn (kgunn72) on 2015-11-20
Changed in canonical-devices-system-image:
status: In Progress → Fix Released
Changed in ubuntu-system-settings-online-accounts:
status: New → Fix Released
Changed in canonical-pocket-desktop:
status: New → Fix Released
kevin gunn (kgunn72) wrote :

spawned bug 1518418 for the governor topic

no longer affects: linux-flo (Ubuntu)
no longer affects: linux-mako (Ubuntu)
Changed in canonical-devices-system-image:
status: Fix Released → Fix Committed
Zoltan Balogh (bzoltan) on 2015-12-05
affects: ubuntu-ui-toolkit (Ubuntu) → ubuntu-ui-toolkit (Ubuntu RTM)
Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers