After an update and restart, switching desktops feels snappy again.
Looking at htop the cpu usage is still higher than expected. And strace
still shows many errors:

jpmeijers@jpmeijers-XPS13-9333:~$ sudo strace -c -p 2217
[sudo] password for jpmeijers: 
strace: Process 2217 attached
^Cstrace: Process 2217 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 29.47    0.004451           4      1008       882 recvmsg
 24.06    0.003634           9       379           poll
 11.86    0.001792           8       222           mprotect
  7.12    0.001076           2       515           ioctl
  7.02    0.001060           6       156           write
  5.56    0.000840           5       161           writev
  3.25    0.000491           2       206           getpid
  2.53    0.000382          11        33           timerfd_create
  2.04    0.000308           9        33           timerfd_settime
  2.00    0.000302           4        62           read
  1.87    0.000283           8        33           close
  1.83    0.000277           8        32         2 futex
  0.93    0.000141          35         4           mmap
  0.44    0.000066          33         2           getrusage
  0.01    0.000001           1         1           restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.015104                  2847       884 total


** Tags added: apport-collected focal

** Description changed:

  After having a couple of terminals and and Chrome windows open for most
  of the day, everything becomes sluggish. Switching desktops is clearly
  very slow and Chrome's windows don't react to all mouse actions.
  
  Looking at htop I can see gnome-shell takes anywhere between 5% and 50%
  of CPU, normally between 10% and 20%.
  
  With Chrome and terminal windows open, an strace on the PID of gnome-
  shell shows the following:
  
  jpmeijers@jpmeijers-XPS13-9333:~$ sudo strace -c -p 3491
  [sudo] password for jpmeijers: 
  strace: Process 3491 attached
  ^Cstrace: Process 3491 detached
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   36.37    0.108651           3     30932     16434 recvmsg
   34.99    0.104531           3     29278           poll
   26.20    0.078272           5     14601           writev
    1.06    0.003158           2      1181           ioctl
    0.35    0.001041           2       430           write
    0.27    0.000812           1       602           getpid
    0.26    0.000773           4       158           read
    0.11    0.000316           3        96           timerfd_create
    0.10    0.000313           3        96           close
    0.10    0.000300           4        73         4 futex
    0.08    0.000241           2        96           timerfd_settime
    0.07    0.000201           0       228           mprotect
    0.04    0.000111          27         4           getrusage
    0.01    0.000038          12         3           sendmsg
    0.00    0.000008           0        11           munmap
    0.00    0.000005           0         6           mmap
    0.00    0.000002           1         2         1 recvfrom
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.298773                 77797     16439 total
  
  
  After closing Chrome windows:
  
  jpmeijers@jpmeijers-XPS13-9333:~$ sudo strace -c -p 3491
  strace: Process 3491 attached
  ^Cstrace: Process 3491 detached
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   36.24    0.099458           3     30319     15900 recvmsg
   35.15    0.096450           3     29053           poll
   26.86    0.073711           5     14500           writev
    0.68    0.001858           1       930           ioctl
    0.40    0.001092           3       318           write
    0.14    0.000386           6        64           close
    0.13    0.000344           0       469           getpid
    0.11    0.000295           4        64           timerfd_create
    0.11    0.000292           1       222           mprotect
    0.06    0.000177           2        64           timerfd_settime
    0.06    0.000153           6        25           munmap
    0.04    0.000121           1       121           read
    0.01    0.000038           0        49         4 futex
    0.01    0.000018           6         3           sendmsg
    0.00    0.000013          13         1           restart_syscall
    0.00    0.000000           0         7           mmap
    0.00    0.000000           0         2           getrusage
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.274406                 76211     15904 total
  
  
  After closing the terminal windows too, therefore only the terminal running 
strace is open:
  
  jpmeijers@jpmeijers-XPS13-9333:~$ sudo strace -c -p 3491
  strace: Process 3491 attached
  ^Cstrace: Process 3491 detached
  % time     seconds  usecs/call     calls    errors syscall
  ------ ----------- ----------- --------- --------- ----------------
   36.43    0.196569           3     54115     27576 recvmsg
   35.25    0.190224           3     53266           poll
   26.92    0.145275           5     26592           writev
    0.30    0.001631           4       405           write
    0.23    0.001245           5       248           mprotect
    0.23    0.001229           9       136           close
    0.21    0.001120           1       621           ioctl
    0.16    0.000889           6       136           timerfd_create
    0.13    0.000711           5       136           timerfd_settime
    0.06    0.000328           1       300           getpid
    0.03    0.000180           2        68         3 futex
    0.03    0.000159           1        85           read
    0.01    0.000053           8         6           sendmsg
    0.01    0.000027           3         9           mmap
    0.00    0.000002           0         3           munmap
    0.00    0.000002           0         4           getrusage
    0.00    0.000000           0         1           recvfrom
  ------ ----------- ----------- --------- --------- ----------------
  100.00    0.539644                136131     27579 total
  
  
  I see the calls and errors to recvmsg climbing. What does this mean, and what 
is causing this?
+ --- 
+ ProblemType: Bug
+ ApportVersion: 2.20.11-0ubuntu27
+ Architecture: amd64
+ CasperMD5CheckResult: skip
+ CurrentDesktop: ubuntu:GNOME
+ DisplayManager: gdm3
+ DistroRelease: Ubuntu 20.04
+ InstallationDate: Installed on 2020-04-25 (31 days ago)
+ InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
+ Package: gnome-shell 3.36.2-1ubuntu1~20.04.1
+ PackageArchitecture: amd64
+ ProcVersionSignature: Ubuntu 5.4.0-31.35-generic 5.4.34
+ RelatedPackageVersions: mutter-common 3.36.2-1ubuntu1~20.04.1
+ Tags:  focal
+ Uname: Linux 5.4.0-31-generic x86_64
+ UpgradeStatus: No upgrade log present (probably fresh install)
+ UserGroups: adm cdrom dialout dip docker lpadmin lxd plugdev sambashare sudo
+ _MarkForUpload: True

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1880723

Title:
  gnome-shell high CPU usage on Ubuntu 20.04

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1880723/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to