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

Bug #1513450 reported by kevin gunn
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Pocket Desktop
Fix Released
Critical
kevin gunn
Canonical System Image
Fix Released
Critical
kevin gunn
Mir
Invalid
Critical
Alberto Aguirre
Online Accounts setup for Ubuntu Touch
Fix Released
Undecided
Unassigned
ubuntu-system-settings (Ubuntu)
Fix Released
Critical
Unassigned
ubuntu-ui-toolkit (Ubuntu RTM)
Fix Released
Critical
Cris 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)
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)
Changed in canonical-pocket-desktop:
importance: High → Critical
Changed in unity8 (Ubuntu):
importance: High → Critical
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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)
Changed in mir:
importance: Undecided → Critical
kevin gunn (kgunn72)
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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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%.

Revision history for this message
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)
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
Revision history for this message
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)

Revision history for this message
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
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Zsombor Egri (zsombi)
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
Revision history for this message
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
Cris Dywan (kalikiana)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: In Progress → Fix Released
kevin gunn (kgunn72)
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
Revision history for this message
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)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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