3

top records nearly 100% cpu usage from gnome-shell when the screen is blanked for power saving (this causes the laptop fans to spin up).

As far as I can tell cpu usage is normal during lock screen or normal use. It happens even after disabling extensions.

The result of strace -tt -C -p <shell_pid> after about half an hour shows most time spent on syscall clock_gettime.

You can see just how much clock_gettime is being called with the millisecond timestamps.

18:48:00.522445 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100562526}) = 0
18:48:00.522466 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100584280}) = 0
18:48:00.522488 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100605864}) = 0
18:48:00.522509 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100626624}) = 0
18:48:00.522530 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100648323}) = 0
18:48:00.522552 sched_yield()           = 0
18:48:00.522572 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100689927}) = 0
18:48:00.522593 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100710853}) = 0
18:48:00.522614 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100731603}) = 0
18:48:00.522635 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100753229}) = 0
18:48:00.522659 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100777169}) = 0
18:48:00.522681 sched_yield()           = 0
18:48:00.522701 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100819210}) = 0
18:48:00.522722 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100840009}) = 0
18:48:00.522743 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100860806}) = 0
18:48:00.522765 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100882561}) = 0
18:48:00.522786 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100904282}) = 0
18:48:00.522808 sched_yield()           = 0
18:48:00.522828 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100946215}) = 0
18:48:00.522849 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100966912}) = 0
18:48:00.522871 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=100988572}) = 0
18:48:00.522891 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=101009223}) = 0
18:48:00.522913 clock_gettime(CLOCK_MONOTONIC, {tv_sec=799890, tv_nsec=101031062}) = 0
18:48:00.522934 sched_yield()           = 0

Summary:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 83.52   89.095703           1  62036388           clock_gettime
 16.18   17.256415           1  11762594           sched_yield
  0.06    0.067132           2     38689     37883 recvmsg
  0.05    0.056288          28      1998           ioctl
  0.04    0.046645           2     30383           getpid
  0.03    0.030072           2     13064     10060 access
  0.02    0.023227           3      8150           poll
  0.02    0.022970           2     12046           read
  0.02    0.020675           2      9445           write
  0.02    0.020551           5      3789        41 futex
  0.01    0.007880           3      2775        96 openat
  0.01    0.006374           2      3048        36 stat
  0.01    0.005624           2      2766           close
  0.01    0.005472           2      3000           getuid
  0.01    0.005397           2      3590           mprotect
  0.00    0.004370           2      2682           fstat
  0.00    0.003257           4       902           writev
  0.00    0.000292           3        94           mmap
  0.00    0.000176           2        87           timerfd_create
  0.00    0.000137           2        68           getrusage
  0.00    0.000133           2        87           timerfd_settime
  0.00    0.000059           7         8           getdents
  0.00    0.000058           6         9           getrandom
  0.00    0.000056          14         4           nanosleep
  0.00    0.000027           7         4           inotify_add_watch
  0.00    0.000006           2         3           madvise
  0.00    0.000006           1         7           recvfrom
  0.00    0.000000           0         1           uname
  0.00    0.000000           0         3           fcntl
  0.00    0.000000           0         1           restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00  106.679002              73935685     48116 total

Disabling clock seconds did not help.

Possibly relevant bug reports:

qwr
  • 2,802
  • Did you ever find the cause of this? I have noticed this (and other glitches) seem to come and go (and then come back) whenever I update the NVIDIA drivers. – Michael Feb 09 '21 at 17:58
  • Sadly I still don't know what causes this. I updated to 20.04 a few months ago and still have the problem. – qwr Feb 09 '21 at 22:05

0 Answers0