Gnome 40 consumes a lot of cpu when moving the mouse or typing really fast on the keyboard
Affected version
Fresh Archlinux install on kernel 5.11.14
- Gnome 40
- Xorg 1.20.11
- Wayland 1.19.0
- Mesa 21.0.2
System Specs
[cappyt@RELightNix ~]$ neofetch
-` cappyt@RELightNix
.o+` -----------------
`ooo/ OS: Arch Linux x86_64
`+oooo: Host: ROG Zephyrus G14 GA401IV_GA401IV 1.0
`+oooooo: Kernel: 5.11.14-arch1-1
-+oooooo+: Uptime: 2 hours, 20 mins
`/:-:++oooo+: Packages: 999 (pacman)
`/++++/+++++++: Shell: bash 5.1.4
`/++++++++++++++: Resolution: 1920x1080
`/+++ooooooooooooo/` DE: GNOME 40.0
./ooosssso++osssssso+` WM: Mutter
.oossssso-````/ossssss+` WM Theme: Nordic
-osssssso. :ssssssso. Theme: Nordic [GTK2/3]
:osssssss/ osssso+++. Icons: Qogir-dark [GTK2/3]
/ossssssss/ +ssssooo/- Terminal: gnome-terminal
`/ossssso+/:- -:/+osssso+- CPU: AMD Ryzen 7 4800HS with Radeon Graphics (16) @ 2.900GHz
`+sso+:-` `.-/+oso: GPU: AMD ATI 04:00.0 Renoir
`++:. `-/+/ Memory: 4972MiB / 39538MiB
.` `/
Bug summary
Whenever any input is registered (mouse, keyboard, or trackpad) this leads to a significant increase in CPU load for the gnome-shell and Xorg user processes. (between 18 and 36%) The CPU is unlikely to be "too slow" as I'm running a Ryzen 7 4800HS on bare metal (no virtualization) the GPU is the integrated Vega-based Renoir one. The issue also happens on Wayland but Wayland itself doesn't use any meaningful CPU, while gnome-shell continues to exhibit the bug.
Steps to reproduce
- Install arch, gnome, and drivers
- Open top, htop, or any other CPU monitoring tool
- Move the mouse (or trackpad, if you have one) or type into a document editor (like gedit) very fast (you might need to spam senseless words on the keyboard)
- Observe the CPU usage increase dramatically
What happened
CPU usage for Xorg and gnome-shell user process skyrocket to half of a core (50% utilization)
What did you expect to happen
Gnome-shell and Xorg using far less CPU
Relevant logs, screenshots, screencasts etc.
I can attach a perf log I made whilst moving the mouse. Commands ran:
- sudo perf record -p $(pidof gnome-shell)
- perf report perf.data perf.data
Things I tried:
- Disabling all extensions, themes, and icons (no effect)
- Lowering the DPI of the mouse (no effect)
- Making sure HW acceleration is on (no effect)
- Using wayland (no effect)
- Disable mouse acceleration (no effect)
- Using Weston (no effect)
Edited by Gabriele Turelli