Bursts of high CPU usage after triggering overview

Bug #1999578 reported by Esokrates
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNOME Shell
Fix Released
Unknown
mutter (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

As requested in the upstream bug report https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6137, I hereby file the downstream issue:

I am experiencing high cpu usage of gnome-shell in situations where I would not expect it, leading to my fans running more often and wasting my battery on my Dell XPS 13 9310 2-in1.

The problem can be seen in action here: https://www.youtube.com/watch?v=Y9o7a7BGPE4
See also the upstream report for syscap recordings of such situations.

I think there might be a correlation with firefox being opened on another workspace (but no video or any other playback happening). At least everytime I notice that my an comes on for no reason and I fire up top to see gnome shell consuming too much cpu, when I kill all my firefox windows gnome shell cpu usage goes down as well, but that could be pure coincidence.

At least I can safely rule out the triple buffering downstream ubuntu mutter patch, since I recompiled mutter without the patch and it does not really change the problem much.

Revision history for this message
Esokrates (esokrarkose) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the bug report. In your video I can see two causes that are not really bugs:

* Firefox using CPU at the same time as gnome-shell means it is Firefox causing the persistent CPU usage in gnome-shell. Make sure Firefox isn't displaying animations like web ads. Even if that doesn't look like the problem, it's still Firefox's fault if the problem is correlated with that app running.

* Triggering the window spread animation causes even higher gnome-shell CPU usage. This is normal and not a bug. Although we welcome patches to make it more efficient.

Suggested workaround: Make Firefox render more efficiently by adding MOZ_ENABLE_WAYLAND=1 to /etc/environment and then reboot. Also don't leave any browser tabs open that you don't need.

Changed in gnome-shell (Ubuntu):
status: New → Opinion
Changed in gnome-shell:
status: Unknown → New
Revision history for this message
Esokrates (esokrarkose) wrote :

Hi Daniel, thanks very much for having a look. What do you think then about Jonas Adahl's observations from the syscap files, that "The frame clocks together dispatches at 1000 Hz at times."? Is this expected to be triggered by firefox as well, despite the window not being in focus?

Furthermore please note, that the high cpu usage holds for almost a minute at times even after the overview animation is over!

Firefox was already using the Wayland in the config I used when reporting the bug.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Indeed per the upstream discussion there *might* be things that can be improved in mutter to reduce this problem. But at the same time it is somewhat expected behaviour. Only unexpected above some unknowable threshold of CPU usage that is system-dependent.

So this bug is not invalid, but also not definitely valid, currently "Opinion".

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually really bursty CPU usage by gnome-shell might be garbage collection, which will be improved in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2377

Changed in gnome-shell:
status: New → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Changed in gnome-shell (Ubuntu):
status: Opinion → Fix Committed
tags: added: fixed-in-mutter-44.1 fixed-upstream
affects: gnome-shell (Ubuntu) → mutter (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mutter - 44.1-1ubuntu1

---------------
mutter (44.1-1ubuntu1) mantic; urgency=medium

  * Merge with Debian (LP: #2020225, LP: #2012100, LP: #2012717,
    LP: #2013216, LP: #2019225, LP: #2006044, LP: #2015861, LP: #1999578,
    LP: #2011251, LP: #2016308)
  * Remaining changes:
    - Add x11-Add-support-for-fractional-scaling-using-Randr.patch
    - Add window-Add-ability-to-override-the-edge-constraints.patch
      + Make possible for extensions (such as Tiling Assistant) to override
        window constraints. (LP: #2007710, #2011611)

mutter (44.1-1) experimental; urgency=medium

  [ Jeremy Bícha ]
  * New upstream release
  * Drop bash patch applied in new release
  * debian/libmutter-12-0.symbols: Add new symbols

  [ Daniel van Vugt ]
  * Update triple buffering patch for Mutter 44.1

  [ Marco Trevisan (Treviño) ]
  * Fix issue with Firefox opening black window in wayland sessions
    - Add d/p/display-Set-compositor-selection-earlier-on-XWayland.patch
      (LP: #1987976)

 -- Jeremy Bícha <email address hidden> Fri, 19 May 2023 16:24:49 -0400

Changed in mutter (Ubuntu):
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.