gnome-shell periodicall becomes extreemely active and eats CPU like crazy

Bug #1943434 reported by Colin Ian King
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

At seemingly random intervals throughout the day gnome-shell becomes very active, the CPU gets very busy and the fans kick in because of the large load.

I attached health-check to the busy process for 60 seconds and got the following utilization stats:

sudo health-check -p gnome-shell
[sudo] password for cking:

CPU usage (in terms of 1 CPU):
     PID Process USR% SYS% TOTAL% Duration
    3271 gnome-shell 29.82 11.20 41.02 60.00 (high load)

Page Faults:
     PID Process Minor/sec Major/sec Total/sec
    3271 gnome-shell 4.60 0.00 4.60

Context Switches:
     PID Process Voluntary Involuntary Total
                               Ctxt Sw/Sec Ctxt Sw/Sec Ctxt Sw/Sec
    3271 gnome-shell 8282.89 16.93 8299.83 (high)
    3294 gnome-shell 909.89 1.40 911.29 (quite high)
    3305 gnome-shell 7.35 0.00 7.35 (low)
    3300 gnome-shell 7.12 0.00 7.12 (low)
    3299 gnome-shell 6.60 0.00 6.60 (low)
    3303 gnome-shell 6.57 0.00 6.57 (low)
    3279 gnome-shell 5.97 0.00 5.97 (low)
    3304 gnome-shell 5.95 0.00 5.95 (low)
    3301 gnome-shell 5.37 0.00 5.37 (low)
    3298 gnome-shell 5.07 0.00 5.07 (low)
    3302 gnome-shell 4.97 0.00 4.97 (low)
    3277 gnome-shell 3.18 0.00 3.18 (low)
    3280 gnome-shell 0.27 0.02 0.28 (very low)
    3286 gnome-shell 0.18 0.03 0.22 (very low)
    3288 gnome-shell 0.18 0.00 0.18 (very low)
    3285 gnome-shell 0.18 0.00 0.18 (very low)
    3287 gnome-shell 0.15 0.02 0.17 (very low)
 Total 9251.88 18.40 9270.28

File I/O operations:
     PID Process Count Op Filename
    3271 gnome-shell 2 R /usr/share/icons/Yaru/cursors/bottom_side
    3271 gnome-shell 1 C /usr/share/icons/Yaru/cursors/bottom_side
    3271 gnome-shell 1 O /usr/share/icons/Yaru/cursors/bottom_side
 Total 4
 Op: O=Open, R=Read, W=Write, C=Close

File I/O Operations per second:
     PID Process Open Close Read Write
    3271 gnome-shell 0.02 0.02 0.03 0.00

System calls traced:
     PID Process Syscall Count Rate/Sec Total μSecs % Call Time
    3271 gnome-shell recvmsg 86510 1441.8150 2874761 0.4511
    3271 gnome-shell ioctl 60197 1003.2706 2474118 0.3883
    3271 gnome-shell poll 33430 557.1596 28079642 4.4066
    3271 gnome-shell getpid 20354 339.2290 594754 0.0933
    3271 gnome-shell writev 14482 241.3636 655887 0.1029
    3271 gnome-shell futex 11787 196.4475 988686 0.1552
    3271 gnome-shell write 9189 153.1481 344908 0.0541
    3271 gnome-shell read 5981 99.6821 160471 0.0252
    3271 gnome-shell mprotect 450 7.4999 11522 0.0018
    3271 gnome-shell mmap 14 0.2333 843 0.0001
    3271 gnome-shell getrusage 12 0.2000 357 0.0001
    3271 gnome-shell recvfrom 9 0.1500 173 0.0000
    3271 gnome-shell close 4 0.0667 451 0.0001
    3271 gnome-shell openat 3 0.0500 185 0.0000
    3271 gnome-shell timerfd_create 3 0.0500 158 0.0000
    3271 gnome-shell timerfd_settime 3 0.0500 188 0.0000
    3271 gnome-shell newfstatat 1 0.0167 38 0.0000
    3271 gnome-shell lseek 1 0.0167 31 0.0000
    3271 gnome-shell restart_syscall 1 0.0167 464 0.0001
    3277 gnome-shell inotify_add_watch 60 1.0000 4858 0.0008
    3277 gnome-shell poll 15 0.2500 55977520 8.7846
    3277 gnome-shell restart_syscall 1 0.0167 2283302 0.3583
    3279 gnome-shell poll 64 1.0667 32540487 5.1066
    3279 gnome-shell write 45 0.7500 1795 0.0003
    3279 gnome-shell recvmsg 26 0.4333 1159 0.0002
    3279 gnome-shell read 18 0.3000 363 0.0001
    3279 gnome-shell futex 7 0.1167 146 0.0000
    3279 gnome-shell sendmsg 2 0.0333 124 0.0000
    3279 gnome-shell restart_syscall 1 0.0167 11793048 1.8507
    3280 gnome-shell restart_syscall 1 0.0167 0 0.0000
    3285 gnome-shell futex 1 0.0167 0 0.0000
    3286 gnome-shell futex 1 0.0167 0 0.0000
    3287 gnome-shell futex 1 0.0167 0 0.0000
    3288 gnome-shell futex 1 0.0167 0 0.0000
    3294 gnome-shell futex 15144 252.3968 57821026 9.0739
    3294 gnome-shell ioctl 9612 160.1980 310731 0.0488
    3294 gnome-shell munmap 13 0.2167 895 0.0001
    3298 gnome-shell futex 95 1.5833 57161056 8.9703
    3298 gnome-shell getpid 10 0.1667 256 0.0000
    3298 gnome-shell gettid 10 0.1667 245 0.0000
    3298 gnome-shell sched_getaffinity 10 0.1667 231 0.0000
    3299 gnome-shell futex 112 1.8666 54323144 8.5250
    3299 gnome-shell getpid 18 0.3000 366 0.0001
    3299 gnome-shell gettid 18 0.3000 515 0.0001
    3299 gnome-shell sched_getaffinity 18 0.3000 371 0.0001
    3300 gnome-shell futex 127 2.1166 54327428 8.5257
    3300 gnome-shell getpid 17 0.2833 306 0.0000
    3300 gnome-shell gettid 17 0.2833 333 0.0001
    3300 gnome-shell sched_getaffinity 17 0.2833 292 0.0000
    3301 gnome-shell futex 97 1.6166 54326990 8.5256
    3301 gnome-shell getpid 13 0.2167 271 0.0000
    3301 gnome-shell gettid 13 0.2167 263 0.0000
    3301 gnome-shell sched_getaffinity 13 0.2167 286 0.0000
    3302 gnome-shell futex 97 1.6166 57178091 8.9730
    3302 gnome-shell getpid 8 0.1333 161 0.0000
    3302 gnome-shell gettid 8 0.1333 181 0.0000
    3302 gnome-shell sched_getaffinity 8 0.1333 139 0.0000
    3303 gnome-shell futex 120 2.0000 54325148 8.5253
    3303 gnome-shell getpid 15 0.2500 270 0.0000
    3303 gnome-shell gettid 15 0.2500 306 0.0000
    3303 gnome-shell sched_getaffinity 15 0.2500 282 0.0000
    3304 gnome-shell futex 107 1.7833 54326438 8.5255
    3304 gnome-shell getpid 16 0.2667 296 0.0000
    3304 gnome-shell sched_getaffinity 16 0.2667 291 0.0000
    3304 gnome-shell gettid 16 0.2667 315 0.0000
    3305 gnome-shell futex 136 2.2666 54324278 8.5252
    3305 gnome-shell getpid 16 0.2667 400 0.0001
    3305 gnome-shell sched_getaffinity 16 0.2667 391 0.0001
    3305 gnome-shell gettid 16 0.2667 363 0.0001
 Total 268674 4477.8431 637222794

Top polling system calls:
     PID Process Syscall Rate/Sec Infinite Zero Minimum Maximum Average
                                                             Timeouts Timeouts Timeout Timeout Timeout
    3271 gnome-shell poll 557.1596 21027 5649 0.0 sec 200.0 msec 11.8 msec
    3277 gnome-shell poll 0.2500 0 0 4.0 sec 4.0 sec 4.0 sec
    3279 gnome-shell poll 1.0667 18 46 0.0 sec 0.0 sec 0.0 sec
 Total 558.4762 21045 5695

Distribution of poll timeout times:
                                                            10.0 100.0 1.0 10.0 100.0 1.0 10.0 100.0
                                                    up to to to to to to to to or more
                                              Zero 9.9 99.9 999.9 9.9 99.9 999.9 9.9 99.9 Infinite
     PID Process Syscall sec usec usec usec msec msec msec sec sec sec Wait
    3271 gnome-shell poll 5649 - - - 2991 1835 1928 - - - 21027
    3277 gnome-shell poll 0 - - - - - - 15 - - 0
    3279 gnome-shell poll 46 - - - - - - - - - 18

Polling system call analysis:
 gnome-shell (3271), poll:
       1202 immediate timed out calls with zero timeout (non-blocking peeks)
         30 repeated timed out polled calls with non-zero timeouts (light polling)
         18 repeated immediate timed out polled calls with zero timeouts (heavy polling peeks)
 gnome-shell (3279), poll:
         20 immediate timed out calls with zero timeout (non-blocking peeks)
          4 repeated immediate timed out polled calls with zero timeouts (heavy polling peeks)

Filesystem Syncs:
 None.

Inotify watches added:
     PID Process Rate/Sec File
    3277 gnome-shell 0.250 /home/cking/.local/share/desktop-directories
    3277 gnome-shell 0.250 /usr/local/share/desktop-directories
    3277 gnome-shell 0.250 /usr/share/ubuntu-xorg/desktop-directories
    3277 gnome-shell 0.250 /var/lib/snapd/desktop/desktop-directories

Memory:
Per Process Memory (K):
     PID Process Type Size RSS PSS
    3271 gnome-shell Stack 132 112 112
    3271 gnome-shell Heap 4009796 184276 184276
    3271 gnome-shell Mapped 758348 118980 41758

Change in memory (K/second):
     PID Process Type Size RSS PSS
    3271 gnome-shell Heap 0.00 0.27 0.27 (growing slowly)
    3271 gnome-shell Mapped -0.07 0.00 0.00 (shrinking slowly)

Heap Change via brk():
 None.

Memory Change via mmap() and munmap():
     PID mmaps munmaps Change (K) Rate (K/Sec)
    3271 gnome-shell 14 0 10416 173.60 (growing moderately fast)
    3294 gnome-shell 0 13 -10292 -171.53 (shrinking moderately fast)

Open Network Connections:
     PID Process Proto Send Receive Address
    3271 gnome-shell UNIX 0.00 B 498.75 K @/tmp/.X11-unix/X0
    3271 gnome-shell UNIX 0.00 B 214.43 K /run/dbus/system_bus_socket
    3279 gnome-shell UNIX 0.00 B 3.08 K /run/snapd.socket
    3279 gnome-shell UNIX 456.00 B 168.00 B /run/systemd/journal/stdout
    3271 gnome-shell UNIX 0.00 B 0.00 B /run/systemd/journal/stdout
    3271 gnome-shell UNIX 0.00 B 0.00 B /run/user/1000/bus
    3271 gnome-shell UNIX 0.00 B 0.00 B @/tmp/.ICE-unix/3236
    3271 gnome-shell NETLINK 0.00 B 0.00 B netlink:[43938]
    3271 gnome-shell NETLINK 0.00 B 0.00 B netlink:[43937]
    3271 gnome-shell UNIX 0.00 B 0.00 B /run/snapd.socket
 Total 456.00 B 716.42 K

Any ideas?

ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: gnome-shell 40.2-1ubuntu6
ProcVersionSignature: Ubuntu 5.13.0-12.12-generic 5.13.3
Uname: Linux 5.13.0-12-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu68
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Mon Sep 13 10:25:07 2021
DisplayManager: gdm3
InstallationDate: Installed on 2021-06-07 (97 days ago)
InstallationMedia: Ubuntu 21.10 "Impish Indri" - Alpha amd64 (20210607)
RelatedPackageVersions: mutter-common 40.2.1-1ubuntu1
SourcePackage: gnome-shell
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Colin Ian King (colin-king) wrote :
Revision history for this message
Colin Ian King (colin-king) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I haven't seen any reports of gnome-shell misbehaving like this in a long time.

Firstly make sure you're not using any non-standard extensions (it looks like you're not?). Look in the 'Extensions' app.

Second, how populated is your desktop (assuming you're using the Desktop Icons NG extension)? I haven't seen any issues with the current extension but its predecessor did have problems like this when the Desktop directory or its contents were touched regularly (log files etc).

The only other cause I can think of would be an expensive garbage collection run. Again, that's usually only a problem when people install non-standard extensions. And your memory usage looks quite normal (heap RSS is 184MB) so I wouldn't imagine garbage collection performance is an issue here.

So other than the usual stuff above, you might have discovered a busy wait in gnome-shell or mutter. I would recommend:

1. Verify the bug occurs with ZERO extensions (no Ubuntu ones either) and then

2. Report it upstream at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gnome-shell (Ubuntu) because there has been no activity for 60 days.]

Changed in gnome-shell (Ubuntu):
status: Incomplete → Expired
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.