Eu tenho um sistema Ubuntu 18.04 usando o Gnome3. Eu tive alguns problemas com meus drivers NVIDIA quando atualizei de 17.04. Depois de algumas iterações de limpeza e instalação de drivers proprietários da nouvea e da nvidia, finalmente consegui instalar os proprietários e, em seguida, alternar para o uso dos gráficos integrados da Intel.
Agora percebo que tenho dois programas Xorg em execução, um pertencente ao gdm e outro pela minha conta de usuário, dannas.
$ ps aux | grep Xorg
gdm 1105 187 0.2 263204 35868 tty1 Rl+ 07:26 8:49 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/128/gdm/Xauthority -background none -noreset -keeptty -verbose 3
dannas 1476 1.6 1.1 899048 182292 tty2 Sl+ 07:26 0:04 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
O que pertence ao gdm consome muita CPU.
$ pidstat -p 1105 1 | head
Linux 4.15.0-23-generic (dannas--dell-xp-15) 06/20/2018 _x86_64_ (8 CPU)
07:29:02 AM UID PID %usr %system %guest %wait %CPU CPU Command
07:29:03 AM 128 1105 94.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:04 AM 128 1105 99.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:05 AM 128 1105 86.00 100.00 0.00 1.00 100.00 7 Xorg
07:29:06 AM 128 1105 99.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:07 AM 128 1105 86.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:08 AM 128 1105 100.00 99.00 0.00 0.00 100.00 1 Xorg
07:29:09 AM 128 1105 93.00 100.00 0.00 0.00 100.00 1 Xorg
Parece estar lendo todos os zeros de fd 16.
$ sudo strace -ttt -p 1105 2>&1 | head
strace: Process 1105 attached
1529472961.641488 read(16, "$ sudo ls -l /proc/1105/fd | grep 16
lr-x------ 1 gdm gdm 64 Jun 20 07:27 16 -> pipe:[29836]
$ (sudo find /proc -type l | sudo xargs ls -l | fgrep 'pipe:[29836]') 2>/dev/null
lr-x------ 1 gdm gdm 64 Jun 20 07:27 /proc/1105/fd/16 -> pipe:[29836]
l-wx------ 1 gdm gdm 64 Jun 20 07:27 /proc/1105/fd/17 -> pipe:[29836]
Jun 20 07:48:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): flip queue failed: Permission denied
Jun 20 07:48:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): Page flip failed: Permission denied
Jun 20 07:48:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (EE) modeset(0): present flip failed
Jun 20 07:49:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): flip queue failed: Permission denied
Jun 20 07:49:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): Page flip failed: Permission denied
Jun 20 07:49:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (EE) modeset(0): present flip failed
$ ps aux | grep Xorg
gdm 1105 187 0.2 263204 35868 tty1 Rl+ 07:26 8:49 /usr/lib/xorg/Xorg vt1 -displayfd 3 -auth /run/user/128/gdm/Xauthority -background none -noreset -keeptty -verbose 3
dannas 1476 1.6 1.1 899048 182292 tty2 Sl+ 07:26 0:04 /usr/lib/xorg/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3
$ pidstat -p 1105 1 | head
Linux 4.15.0-23-generic (dannas--dell-xp-15) 06/20/2018 _x86_64_ (8 CPU)
07:29:02 AM UID PID %usr %system %guest %wait %CPU CPU Command
07:29:03 AM 128 1105 94.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:04 AM 128 1105 99.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:05 AM 128 1105 86.00 100.00 0.00 1.00 100.00 7 Xorg
07:29:06 AM 128 1105 99.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:07 AM 128 1105 86.00 100.00 0.00 0.00 100.00 7 Xorg
07:29:08 AM 128 1105 100.00 99.00 0.00 0.00 100.00 1 Xorg
07:29:09 AM 128 1105 93.00 100.00 0.00 0.00 100.00 1 Xorg
$ sudo strace -ttt -p 1105 2>&1 | head
strace: Process 1105 attached
1529472961.641488 read(16, "$ sudo ls -l /proc/1105/fd | grep 16
lr-x------ 1 gdm gdm 64 Jun 20 07:27 16 -> pipe:[29836]
$ (sudo find /proc -type l | sudo xargs ls -l | fgrep 'pipe:[29836]') 2>/dev/null
lr-x------ 1 gdm gdm 64 Jun 20 07:27 /proc/1105/fd/16 -> pipe:[29836]
l-wx------ 1 gdm gdm 64 Jun 20 07:27 /proc/1105/fd/17 -> pipe:[29836]
Jun 20 07:48:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): flip queue failed: Permission denied
Jun 20 07:48:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): Page flip failed: Permission denied
Jun 20 07:48:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (EE) modeset(0): present flip failed
Jun 20 07:49:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): flip queue failed: Permission denied
Jun 20 07:49:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (WW) modeset(0): Page flip failed: Permission denied
Jun 20 07:49:00 dannas--dell-xp-15 /usr/lib/gdm3/gdm-x-session[1103]: (EE) modeset(0): present flip failed
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 40) = 36
1529472961.641525 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641547 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 40) = 40
1529472961.641568 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641588 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 40) = 29
1529472961.641609 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641627 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 40) = 28
1529472961.641647 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641666 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 40) = 27
%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 40) = 36
1529472961.641525 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641547 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%"..., 40) = 40
1529472961.641568 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641588 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 40) = 29
1529472961.641609 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641627 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 40) = 28
1529472961.641647 epoll_wait(4, [{EPOLLIN, {u32=445731056, u64=94777489051888}}], 256, -1) = 1
1529472961.641666 read(16, "%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 40) = 27
Quando eu anexei o gdb, não vi nada nos backtraces além de chamadas para epoll_wait e leitura e nomes genéricos como BlockHandler e WaitForSomething e WaitForSomething.
O descritor de arquivo 16 é um canal ...
%pre%Que está conectado ao mesmo programa Xorg (?).
%pre%No final da saída do journalctl, vejo
%pre%Esta é a sessão do gdm-x controlando o programa Xorg que está consumindo 200% de cpu.
Alguma sugestão sobre como proceder para a resolução de problemas? Espera-se que haja duas instâncias do Xorg? Como as instâncias do Xorg são criadas? Qual arquivo de configuração os controla?
Se eu matar o Xorg, então resta apenas um Xorg que consome a quantidade normal de cpu 1-10% e posso continuar usando meu computador.