2

I'm having some issues with CPU usage when using wireless connection on my laptop.

This has never happened on wired connection, therefore I'm assuming wifi connection is somewhat related.

top says that most resources are used by gnome-shell, browser, and some kworker processes.

Situation also gets worse the more network resources are used (for example if I start a download). Here's an htop screen, as soon as I started a download several gnome-shell processes showed very high cpu usage: enter image description here

Tried using perf to see what uses the CPU most as suggested here: https://askubuntu.com/a/422151/700229 but couldn't find anything that would point me in the right direction, but the output was probably bad:

✓ ~→ sudo perf record -g -a sleep 10
Lowering default frequency rate to 1250.
Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
[ perf record: Woken up 9 times to write data ]
Warning:
Processed 52550 events and lost 2 chunks!

Check IO/CPU overload!

[ perf record: Captured and wrote 7.214 MB perf.data (26167 samples) ]

Here's the output of lspci -v:

3b:00.0 Network controller: Intel Corporation Wireless-AC 9260 (rev 29)
        Subsystem: Intel Corporation Device 4010
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at ed400000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: <access denied>
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi

And iwconfig:

lo        no wireless extensions.

br-2d6609084b03  no wireless extensions.

br-7083ba6447c1  no wireless extensions.

docker0   no wireless extensions.

wlp59s0   IEEE 802.11  ESSID:"XXX"
          Mode:Managed  Frequency:5.5 GHz  Access Point: XX:XX:XX:XX:XX:XX
          Bit Rate=650 Mb/s   Tx-Power=22 dBm
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=45/70  Signal level=-65 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:7  Invalid misc:113   Missed beacon:0

I've checked that CPU is set to performance in tlp and that wifi battery saver is disabled.

Now I'm kind of lost here what to look for next. Any help is very appreciated because my work depends on resolving this.

UPD Installed gnome extensions:

✓ ~→ ls -al ~/.local/share/gnome-shell/extensions
total 80
drwxrwxr-x 20 sergio sergio 4096 Mar 15 17:33 .
drwx------  3 sergio sergio 4096 Mar 15 17:31 ..
drwxrwxr-x  3 sergio sergio 4096 Jul 24  2019 [email protected]
drwxrwxr-x  3 sergio sergio 4096 Jun 13  2019 [email protected]
drwxrwxr-x  3 sergio sergio 4096 Mar 15 17:33 [email protected]
drwxrwxr-x  4 sergio sergio 4096 Aug  5  2019 [email protected]
drwxrwxr-x  5 sergio sergio 4096 Jun 13  2019 [email protected]
drwxrwxr-x  3 sergio sergio 4096 Jul 24  2019 [email protected]
drwxrwxr-x  4 sergio sergio 4096 Feb 28 14:25 [email protected]
drwxrwxr-x  2 sergio sergio 4096 Sep 27 12:22 [email protected]
drwxrwxr-x  2 sergio sergio 4096 Jul 24  2019 [email protected]
drwxrwxr-x  5 sergio sergio 4096 Feb 28 14:25 [email protected]
drwxrwxr-x  3 sergio sergio 4096 Jul 24  2019 native-window-placement@gnome-shell-extensions.gcampax.github.com
drwxrwxr-x  2 sergio sergio 4096 Jun 13  2019 [email protected]
drwxrwxr-x  3 sergio sergio 4096 Jul 24  2019 [email protected]
drwxrwxr-x  2 sergio sergio 4096 Sep 19 15:35 [email protected]
drwxrwxr-x  4 sergio sergio 4096 Feb 22 16:20 [email protected]@posteo.de
drwxrwxr-x  4 sergio sergio 4096 Jun 13  2019 [email protected]
drwxrwxr-x  3 sergio sergio 4096 Jul 24  2019 [email protected]
drwxrwxr-x  3 sergio sergio 4096 Aug  5  2019 [email protected]

✓ ~→ ls -al /usr/share/gnome-shell/extensions
total 48
drwxr-xr-x 12 root root 4096 Aug  5  2019 .
drwxr-xr-x  6 root root 4096 Jan 15 06:59 ..
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 native-window-placement@gnome-shell-extensions.gcampax.github.com
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]
drwxr-xr-x  2 root root 4096 Jun 13  2019 [email protected]

UPD2 htop in idle state: enter image description here

UPD3 free mem and swappiness:

✓ ~→ free -h
              total        used        free      shared  buff/cache   available
Mem:            30G        2.4G         24G        782M        3.6G         27G
Swap:           16G          0B         16G

✓ ~→ sysctl vm.swappiness
vm.swappiness = 10
4
  • You probably have some GNOME Shell extensions sucking up a bunch of CPU cycles. Edit your question and show me ls -al ~/.local/share/gnome-shell/extensions and ls -al /usr/share/gnome-shell/extensions. Start comments to me with @heynnema or I may miss them.
    – heynnema
    Mar 15, 2020 at 16:31
  • Thanks @heynnema , this is actually what I was just checking myself. I've updated the question with the output. Mar 15, 2020 at 16:36
  • Please see my answer. It it turns out to be helpful, please remember to accept my answer by clicking the checkmark icon that appears just to the left of my answer. Thanks!
    – heynnema
    Mar 15, 2020 at 16:45
  • Thanks for your input @heynnema. Was just doing the same myself after posting this question. Will mark your answer as accepted if this turns out to be the issue. What threw me off at first is that this only happens on high network usage while on wireless :/ I hope extensions are really the issue here. Mar 15, 2020 at 16:47

2 Answers 2

0

Holy !@#$% Batman. You've got WAY too manu GNOME Shell extensions, and many of them are duplicated in both places where extensions should exist.

System extensions are seen with ls -al /usr/share/gnome-shell/extensions should only contain these (19.10):

drwxr-xr-x 2 root root 4096 Nov  2 14:36 desktop-icons@csoriano
drwxr-xr-x 3 root root 4096 Nov  2 14:36 [email protected]
drwxr-xr-x 3 root root 4096 Mar 12 16:22 [email protected]

User extensions are normally seen via ls -al ~/.local/share/gnome-shell/extensions.

Remove the duplicates in /usr/share/gnome-shell/extensions.

Then restart GNOME Shell, or better yet, just reboot.

Then temporarily turn OFF ALL remaining extensions at https://extensions.gnome.org/local/ and retest your system. Turn ON only one extension at a time during testing. Monitor the top command, and GNOME Shell CPU usage should be less than 2%. The goal would be to only have 5-6 extensions enabled max. Ditch the rest.

Then restart GNOME Shell, or better yet, just reboot.

13
  • I have tried disabling every extension. As a test running 720p video on youtube. Still seeing the same issue with high CPU usage, though now I don't see multiple gnome-shell processes eating up CPU apart from the main one (main shell?). Now there are several processes that pop-up: thermald, pulseaudio and browser. Mar 15, 2020 at 17:57
  • @SergioLeone Edit your question and show me the latest screenshot of top/htop when the computer is idle.
    – heynnema
    Mar 15, 2020 at 18:00
  • @SergioLeone When viewing a 720p video, I'd expect CPU usage to be high. What does that have to do with your problem with wifi? Your recent htop looks normal.
    – heynnema
    Mar 15, 2020 at 18:10
  • It's not that the usage is just "high", sorry for not being clear. It's that the system starts lagging and freezing, video starts lagging as well, etc. Again, this does not happen on wired network connection, only on wireless (and also I've tried with different wireless netowrks - at work and home - and results are same). I've used youtube to load up network, the behavior is the same if I, for example, download a file. Mar 15, 2020 at 18:11
  • @SergioLeone ah... edit your question and show me free -h and sysctl vm.swappiness.
    – heynnema
    Mar 15, 2020 at 18:13
0

I have the same issue. Turn on Airplane mode and reactivate wifi. That worked for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .