Constant cpu usage rising
Affected version
- Gnome shell 3.36.2 (exact package name is 3.36.2+7+ge4199c71-1) on Wayland
- OS: Arch LTS kernel 5.4.41
- Machine: XPS 13 9380
Bug summary
I noticed that overtime the CPU usage of gnome-shell increases, starting just after reboot with a constant 3-4% global cpu usage to 8-10% after 1 day. I tried to track down the issue with strace and noticed that there are constantly failed recmsg on a Unix socket
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
I disabled all extensions, removed automount of an external google drive but I still have the issue. I also tried on Xorg, and latest (non-lts arch kernel) and it is the same.
Steps to reproduce
The strace recmsg errors appear just after the boot
What happened
See the socket constant recvmsg errors below found with strace. Not sure if it is normal.
❯ pgrep -fa gnome-shell
1984 /usr/bin/gnome-shell
❯ sudo strace -e trace=network -p 1984
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
sendmsg(82, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base=")\0\0\0\0\0\f\0\311\361\321\0\1\0\0\0\1\0\f\0)\0\0\0", iov_len=24}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 24
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
sendmsg(82, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="1\0\0\0\3\0\30\0\367\24\0\0\310\361\321\0.\0\0\0\1\0\0\0\r\0\0\0\3\0\30\0"..., iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 48
recvmsg(82, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\22\0\0\0\3\0\f\0)\0\0\0\22\0\0\0\1\0\24\0;\0\0\0\0\0\0\0\0\0\0\0"..., iov_len=1432}, {iov_base="", iov_len=2664}], msg_iovlen=2, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_CMSG_CLOEXEC) = 64
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
sendmsg(82, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base=":\0\0\0\0\0\10\0", iov_len=8}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 8
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(81, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
sendmsg(82, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base=")\0\0\0\0\0\f\0\326\361\321\0\1\0\0\0\1\0\f\0)\0\0\0", iov_len=24}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 24
recvmsg(82, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\22\0\0\0\3\0\f\0)\0\0\0\22\0\0\0\1\0\24\0007\0\0\0\0\0\0\0\0\0\0\0"..., iov_len=1368}, {iov_base="", iov_len=2728}], msg_iovlen=2, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_CMSG_CLOEXEC) = 64
The socket with fd 81 belongs to gnome-shell
ls -al /proc/1984/fd
lrwx------ 1 luc luc 64 May 18 10:04 81 -> 'socket:[41415]'
lrwx------ 1 luc luc 64 May 18 10:04 82 -> 'socket:[35346]'
❯ sudo lsof | rg 41415
lsof: WARNING: can't stat() fuse.rclone file system /mnt/gdrive
Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gocryptfs file system /mnt/gdrive-cleardata
Output information may be incomplete.
gnome-she 1984 luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2003 gmain luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2010 gdbus luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2015 dconf\x20 luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2058 gnome-s:d luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2059 gnome-s:d luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2060 gnome-s:d luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2061 gnome-s:d luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2100 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2101 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2102 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2103 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2104 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2105 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2106 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 2107 JS\x20Hel luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11927 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11928 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11929 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11930 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11931 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11932 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11933 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 11934 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 12119 threaded- luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
gnome-she 1984 15172 pool-gnom luc 81u unix 0x0000000086f94d98 0t0 41415 type=STREAM
^C
What did you expect to happen
No recmsg errors