3

I am running ubuntu 18.04 on a old(ish) laptop, it's a hp dv7 6180sl with upgraded ram (16gb) and SSD. It's old but still fast enough for my job.

Since a few ubuntu versions (I always do a complete reinstall at every release, so I'm not coming from an older version) it looks like the cpu is never really idle, thus tha fans are always working. Today I have decided to find out what is using my cpu.

I've read lots of answers here and on google, but nothing really solved my problem. Top says this:

PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
5501 tox       20   0 3911436 324668  68984 S  12,5  4,0  30:04.86 gnome-shell 

Taking the PID of gnome-shell, I've tried to do a strace to see what happens under the hood, and I saw that there is a recvmsg syscall that gives a big amount of errors, taking almost 30% of the time (this is after almost a minute):

strace: Process 5501 attached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
29.71    0.100941           2     46612     39214 recvmsg
24.81    0.084290           5     17842           poll
22.21    0.075445           3     21796           ioctl
8.92    0.030304           4      7269           writev
3.72    0.012652           8      1583        53 futex
3.17    0.010771           2      5180           getpid
1.58    0.005380           1      3874           mprotect
1.58    0.005357           3      2003           write
1.46    0.004969           3      1958           read
0.51    0.001727           8       215         2 openat
0.48    0.001634           3       501           close
0.45    0.001533           5       288           timerfd_create
0.32    0.001098           4       288           timerfd_settime
0.32    0.001072           6       183           mmap
0.26    0.000887           7       132       114 stat
0.25    0.000838           2       426           fstat
0.11    0.000370           2       213           fcntl
0.08    0.000267          10        26           munmap
0.06    0.000191           1       146           getrusage
0.00    0.000001           0         4         1 recvfrom
0.00    0.000001           1         2           uname
0.00    0.000001           1         1           restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.339729                110542     39384 total

Is that something I should worry about?

  • I actually have a few extensions. I have tried to disable them using gnome-tweak-tool but nothing seems to be changing... – ToX 82 Jun 7 '18 at 12:33
  • Try disabling all, reboot and check. – pomsky Jun 7 '18 at 12:35
  • That's what I did. The recvmsg errors count is significantly lower, but still I have a pretty high CPU usage. – ToX 82 Jun 7 '18 at 12:52
1

I have had similar consistent high CPU load on gnome-shell for no clear reason since installing 18.04. I figured it was just obscuring something under the hood like firefox video rendering, but it also doesn't really go down anywhere near zero even with every program closed and even without moving the mouse.

I tried the same strace and get similar results:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 39.61    0.240174           3     87585     76642 recvmsg
 25.36    0.153778           6     27384           poll
  9.07    0.054990           3     17502           ioctl
  8.98    0.054434           3     18079           write
  7.98    0.048402           5      9702           writev
  3.29    0.019926           3      6640           read
  2.20    0.013369           1      8942           getpid
  1.32    0.008014           6      1352        59 futex
  0.91    0.005530           2      2634           mprotect
  0.23    0.001413          20        72           mmap
  0.21    0.001299           4       353           close
  0.21    0.001272           5       240           timerfd_create
  0.17    0.001043          10       101         2 openat
  0.17    0.001010           4       240           timerfd_settime
  0.09    0.000518           1       420       360 stat
  0.07    0.000432           2       198           fstat
  0.06    0.000374           9        41           munmap
  0.03    0.000192           2       124           getrusage
  0.03    0.000184           2        99           fcntl
  0.00    0.000006           2         4           recvfrom
  0.00    0.000004           1         7           sendmsg
  0.00    0.000004           1         7           ftruncate
  0.00    0.000004           1         7           memfd_create
  0.00    0.000003           2         2           uname
  0.00    0.000001           0         7           lseek
  0.00    0.000000           0         1           restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.606376                181743     77063 total

It's pretty bad, I have stuttering at about a 1 sec interval across all my programs. It's so consistent I've gotten used to compensating for it. Video playback stutters, games stutter, firefox stutters, it's pretty annoying. No idea where to start on fixing it, though killing gnome-shell and restarting it at least works for a while -- still with the errors, but more responsive.

Side bar on the left often also glitches with overlapping icons and the like, I suspect there's some cumulative errors gnome-shell gets into and that at some point it is spending a lot of CPU time trying to resolve badly interacting contradictions between some configuration or edge case or something. I guess at this point I'll just hope 18.10 is any better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.