High CPU usage while screen is locked
Affected version
Ubuntu 22.10, gnome-shell 43.0, Wayland
Bug summary
Sometimes, when I lock my screen and walk away, I come back to find the CPU fan spinning full throttle, with gnome-shell consuming about 76% of CPU. The CPU usage goes down as soon as I unlock.
This happens only when I have certain web pages open in Firefox (e.g. Reddit discussions). I'm less certain of this, but I think the web page needs to have an animation. https://bugzilla.mozilla.org/show_bug.cgi?id=1587040 is probably related, although that particular Firefox bug seems to be Windows specific?
Steps to reproduce
- Open Firefox, go to https://www.reddit.com/r/anime/comments/z43moo/yuru_camp_movie_discussion/
- Lock the screen, wait 20 seconds
What happened
After about 7 seconds, CPU usage starts spiking.
What did you expect to happen
No high CPU usage while the screen is turned off please, even if Firefox is trying to draw something at 8700 fps.
Relevant logs, screenshots, screencasts etc.
I'm looking at a Sysprof recording without call stacks (Ubuntu builds with -fomit-frame-pointer, so those are useless) but with gnome-shell markers. I tried to lock the screen as soon as I entered my password after starting the recording, and I tried to stop the recording as soon as I unlocked the screen (fast-ish fingerprint unlock + hunting for the stop button + another password entry aargh). I see this:
I don't know how to interpret these numbers, but there seems to be a suspicious number of Frame Clock markers -- 192887, or about 8700 per second. There are also two interesting markers of KMS (post update) and Onscreen (post pending update) at 545 ms, which is the last thing that happens in the low CPU frequency through, and after which the high CPU usage starts.
The .syscap file is 147M, which might be too big for GitLab? Here's a Dropbox link.