[troubleshoot][archlinux][X] plasma(KDE) 窗口滚动刷新冻结(约延迟10s)(已解决,root cause不明,无法再次复现)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[troubleshoot][archlinux][X] plasma(KDE) 窗口滚动刷新冻结(约延迟10s)(已解决,root cause不明,无法再次复现)相关的知识,希望对你有一定的参考价值。
现象:
konsole,setting等plasma的系统应用反应缓慢,在滚动条滚动时,尤为明显。
触发条件:
并不是十分明确的系统滚动升级(Syu)后,产生。
现象收集:
可疑的dmesg
[ 35.728342] nouveau 0000:04:00.0: DRM: resuming kernel object tree... [ 35.728469] nouveau 0000:04:00.0: priv: HUB0: 6013d4 badf573f (1e408200) [ 35.766014] nouveau 0000:04:00.0: priv: HUB0: 10ecc0 ffffffff (1b40822c) [ 35.766423] nouveau 0000:04:00.0: DRM: resuming client object trees...
可疑的journal 1
Oct 07 14:00:33 T7 kernel: nouveau 0000:04:00.0: DRM: VRAM: 1024 MiB Oct 07 14:00:33 T7 kernel: nouveau 0000:04:00.0: DRM: GART: 1048576 MiB Oct 07 14:00:33 T7 kernel: nouveau 0000:04:00.0: DRM: Pointer to TMDS table invalid Oct 07 14:00:33 T7 kernel: nouveau 0000:04:00.0: DRM: DCB version 4.0 Oct 07 14:00:33 T7 kernel: nouveau 0000:04:00.0: DRM: Pointer to flat panel table invalid
可疑的journal 2
Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::begin: Paint device returned engine == 0, type: 3 Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setRenderHint: Painter must be active to set rendering hints Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setWindow: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setClipRect: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::save: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setRenderHint: Painter must be active to set rendering hints Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setPen: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setBrush: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setClipRect: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::drawRects: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::restore: Unbalanced save/restore Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::save: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setPen: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setBrush: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::drawRects: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setRenderHint: Painter must be active to set rendering hints Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setBrush: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setPen: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::restore: Unbalanced save/restore Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setFont: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setPen: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::fontMetrics: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::save: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::translate: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::restore: Unbalanced save/restore Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::save: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::translate: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::setRenderHint: Painter must be active to set rendering hints Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::translate: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::scale: Painter not active Oct 07 12:41:32 T7 kwin_x11[693]: QPainter::translate: Painter not active
处理步骤:
基于上面的信息,首先判断是驱动 nouveau 的问题。该驱动指向PCIe地址 04:00.0,查看发现该地址为Nvidia独立显卡。
[[email protected] ~]$ lspci -nn -s 04:00.0 04:00.0 3D controller [0302]: NVIDIA Corporation GM108M [GeForce 940M] [10de:1347] (rev a2) [[email protected] ~]$
首先,怀疑是显卡驱动除了问题。需要提到的一个前提时,T450为双显卡笔记本,我在安装系统时变考虑到了Nvidia显卡的兼容性问题,而只安装了集成显卡的驱动。所以,现在怀疑可能是其他包的依赖关系,导致了Nvidia的驱动被安装了。然后由于这个驱动的更新或者兼容导致了现在的问题。接下来进行想法验证。
[[email protected] ~]$ readlink /sys/bus/pci/devices/0000\:04\:00.0/driver ../../../../bus/pci/drivers/nouveau [[email protected] ~]$ lsmod |grep ^nouveau nouveau 1482752 0 [[email protected] ~]$ modinfo nouveau |grep filename filename: /lib/modules/4.7.6-1-ARCH/kernel/drivers/gpu/drm/nouveau/nouveau.ko.gz [[email protected] ~]$ pacman -Qo /lib/modules/4.7.6-1-ARCH/kernel/drivers/gpu/drm/nouveau/nouveau.ko.gz /usr/lib/modules/4.7.6-1-ARCH/kernel/drivers/gpu/drm/nouveau/nouveau.ko.gz is owned by linux 4.7.6-1 [[email protected] ~]$ cat /var/log/pacman.log |grep upgraded |grep linux |grep ‘4.7.6‘ [2016-10-06 15:55] [ALPM] upgraded linux (4.7.4-1 -> 4.7.6-1) [[email protected] ~]$
通过以上内容,能够看出独立显卡确实被nouveau驱动所使用,且该驱动包含与内核包中,该包也确实在系统滚动中进行了升级。
由于我并不需要独立显卡,所以我的思路是将独立显卡禁用掉,从而简单有效的解决这个问题。
另外,需要指出的是在这个逻辑中包含着一个疑问,就是nouveau驱动的作用到底是什么?在当前系统状态下独立显卡起到的作用时什么?我一直以为当我没有为Nvidia显卡安装驱动的情况下,它就不会被使用,然而事实并非如此,具体的细节等问题我尚没有理解清楚,可以通过阅读archlinux关于xorg的章节进行后续了解。
回到禁用独立网卡的问题。无外乎几种方法:1. 在硬件层禁用,一般的Bios里都有这样的选项,但是我的并没有。2. 在系统层面禁用,如udev和kernel等。3. 正确的驱起来,因为这种设计本身就是为了双网卡切换,只有都驱好然后一直使用集成的卡,不使用独立卡,应该也是可以的吧?!Optimus 这个也需要再研究
我采用禁用nouveau驱动的方式来禁用独立显卡。
[[email protected] ~]$ cat /etc/modprobe.d/black-list.conf blacklist nouveau [[email protected] ~]$ systemctl reboot
重启之后,使用 lsmod 以及查看 /sys/bus/pci/devices/0000\:04\:00.0/driver 文件可以判断,独立显卡没有被驱动。
但是,窗口刷新慢的情况并没有得到解决。接着,换一个思路,也行并不是驱动的问题,通过前文看到的journal2信息,怀疑很有可能是plasma的问题。查看了plasma的文档,其中包含的troubleshooting章节提到了一些有用的信息。
第一,做了清除所有既有配置的操作,并没有解决问题。
[[email protected] ~]$ mv ~/.config/plasma* backup/ [[email protected] ~]$ mv .kde4/ backup/ [[email protected] ~]$
第二,清除并重建cache,问题未解决。
$ rm ~/.config/Trolltech.conf
$ kbuildsycoca4 --noincremental
第三,查看kwin状态,并未获取有用信息。
$ qdbus org.kde.KWin /KWin supportInformation
然后,基于以上显卡及kde配置相关的信息情况,很自然的想到进入kde配置页,调整显示配置,compositor 等内容,进行尝试。
在compositor页面看见系统提示的错误信息,表示compositor没有正确启用。然后,我去除了nouveau的blacklist, 并重启,再次进入conpositor配置页,错误信息消失。窗口刷新问题也神奇的得到修正,
1. 窗口刷新慢的问题消失。
2. nouveau的日志信息仍然存在,journal 2 的日志内容消失。
结论:
1. 由于问题已经不能复现,故无法追查root cause。我猜测应该是清除并重建cache解决了问题,但是查看所以更新包,并没有plasma相关的包被更新,只有几个qt5相关的包。所有更新如下:
[[email protected] ~]$ cat /var/log/pacman.log |grep 2016-10-06 |grep upgraded
[2016-10-06 15:53] [ALPM] upgraded tzdata (2016f-1 -> 2016g-1)
[2016-10-06 15:53] [ALPM] upgraded iana-etc (20160921-1 -> 20160927-1)
[2016-10-06 15:53] [ALPM] upgraded babl (0.1.16-1 -> 0.1.18-1)
[2016-10-06 15:53] [ALPM] upgraded libsystemd (231-1 -> 231-3)
[2016-10-06 15:53] [ALPM] upgraded bluez (5.41-2 -> 5.42-1)
[2016-10-06 15:53] [ALPM] upgraded bluez-libs (5.41-2 -> 5.42-1)
[2016-10-06 15:53] [ALPM] upgraded breeze-icons (5.26.0-1 -> 5.26.0-2)
[2016-10-06 15:53] [ALPM] upgraded c-ares (1.11.0-1 -> 1.12.0-1)
[2016-10-06 15:53] [ALPM] upgraded openssl (1.0.2.i-1 -> 1.0.2.j-1)
[2016-10-06 15:53] [ALPM] upgraded systemd (231-1 -> 231-3)
[2016-10-06 15:53] [ALPM] upgraded nettle (3.2-2 -> 3.3-1)
[2016-10-06 15:53] [ALPM] upgraded libcups (2.2.0-3 -> 2.2.1-1)
[2016-10-06 15:53] [ALPM] upgraded libx11 (1.6.3-1 -> 1.6.4-1)
[2016-10-06 15:53] [ALPM] upgraded libxi (1.7.6-1 -> 1.7.7-1)
[2016-10-06 15:53] [ALPM] upgraded libxrender (0.9.9-1 -> 0.9.10-1)
[2016-10-06 15:53] [ALPM] upgraded libxrandr (1.5.0-1 -> 1.5.1-1)
[2016-10-06 15:53] [ALPM] upgraded libxfixes (5.0.2-1 -> 5.0.3-1)
[2016-10-06 15:53] [ALPM] upgraded libdrm (2.4.70-1 -> 2.4.71-1)
[2016-10-06 15:53] [ALPM] upgraded mesa (12.0.3-1 -> 12.0.3-2)
[2016-10-06 15:53] [ALPM] upgraded mesa-libgl (12.0.3-1 -> 12.0.3-2)
[2016-10-06 15:53] [ALPM] upgraded libxtst (1.2.2-1 -> 1.2.3-1)
[2016-10-06 15:53] [ALPM] upgraded libtool (2.4.6-5 -> 2.4.6-6)
[2016-10-06 15:54] [ALPM] upgraded chromium (53.0.2785.116-1 -> 53.0.2785.143-1)
[2016-10-06 15:54] [ALPM] upgraded containerd (0.2.3-1 -> 0.2.4-1)
[2016-10-06 15:54] [ALPM] upgraded openjpeg2 (2.1.1-2 -> 2.1.2-1)
[2016-10-06 15:54] [ALPM] upgraded cups (2.2.0-3 -> 2.2.1-1)
[2016-10-06 15:54] [ALPM] upgraded device-mapper (2.02.165-1 -> 2.02.166-1)
[2016-10-06 15:54] [ALPM] upgraded libxv (1.0.10-1 -> 1.0.11-1)
[2016-10-06 15:54] [ALPM] upgraded libmm-glib (1.6.0-1 -> 1.6.2-1)
[2016-10-06 15:54] [ALPM] upgraded libnm-glib (1.4.1dev+33+gc87b89b-1 -> 1.4.2-1)
[2016-10-06 15:54] [ALPM] upgraded xkeyboard-config (2.18-1 -> 2.19-1)
[2016-10-06 15:54] [ALPM] upgraded eclipse-common (4.6.0-1 -> 4.6.1-1)
[2016-10-06 15:54] [ALPM] upgraded eclipse-java (4.6.0-1 -> 4.6.1-1)
[2016-10-06 15:54] [ALPM] upgraded qt4 (4.8.7-9 -> 4.8.7-10)
[2016-10-06 15:54] [ALPM] upgraded fcitx-sogoupinyin (2.0.0.0078-3 -> 2.1.0.0082-1)
[2016-10-06 15:54] [ALPM] upgraded libass (0.13.2-1 -> 0.13.3-1)
[2016-10-06 15:54] [ALPM] upgraded libx264 (2:148.20160613-2 -> 2:148.20160920-1)
[2016-10-06 15:54] [ALPM] upgraded x265 (2.0-1 -> 2.1-1)
[2016-10-06 15:54] [ALPM] upgraded ffmpeg (1:3.1.3-2 -> 1:3.1.4-2)
[2016-10-06 15:54] [ALPM] upgraded gc (7.4.2-4 -> 7.6.0-1)
[2016-10-06 15:54] [ALPM] upgraded ghostscript (9.19-3 -> 9.20-2)
[2016-10-06 15:54] [ALPM] upgraded gst-plugins-bad (1.8.3-1 -> 1.8.3-2)
[2016-10-06 15:54] [ALPM] upgraded hostapd (2.5-2 -> 2.6-2)
[2016-10-06 15:54] [ALPM] upgraded hplip (3.16.8-2 -> 3.16.9-1)
[2016-10-06 15:55] [ALPM] upgraded jsoncpp (1.7.5-1 -> 1.7.6-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-libdrm (2.4.70-1 -> 2.4.71-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-libx11 (1.6.3-1 -> 1.6.4-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-libxfixes (5.0.2-1 -> 5.0.3-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-libxi (1.7.6-1 -> 1.7.7-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-libxrender (0.9.9-1 -> 0.9.10-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-libxrandr (1.5.0-1 -> 1.5.1-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-wayland (1.11.0-1 -> 1.12.0-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-mesa (12.0.3-1 -> 12.0.3-2)
[2016-10-06 15:55] [ALPM] upgraded lib32-mesa-libgl (12.0.3-1 -> 12.0.3-2)
[2016-10-06 15:55] [ALPM] upgraded lib32-mesa-vdpau (12.0.3-1 -> 12.0.3-2)
[2016-10-06 15:55] [ALPM] upgraded lib32-openssl (1:1.0.2.i-1 -> 1:1.0.2.j-1)
[2016-10-06 15:55] [ALPM] upgraded lib32-util-linux (2.28.1-1 -> 2.28.2-1)
[2016-10-06 15:55] [ALPM] upgraded libaccounts-glib (1.22-1 -> 1.23-1)
[2016-10-06 15:55] [ALPM] upgraded qt5-base (5.7.0-2 -> 5.7.0-3)
[2016-10-06 15:55] [ALPM] upgraded libaccounts-qt (1.14-2 -> 1.15-1)
[2016-10-06 15:55] [ALPM] upgraded libmariadbclient (10.1.17-1 -> 10.1.18-1)
[2016-10-06 15:55] [ALPM] upgraded libxvmc (1.0.9-1 -> 1.0.10-1)
[2016-10-06 15:55] [ALPM] upgraded mpfr (3.1.4.p1-1 -> 3.1.5-1)
[2016-10-06 15:55] [ALPM] upgraded linux (4.7.4-1 -> 4.7.6-1)
[2016-10-06 15:56] [ALPM] upgraded lvm2 (2.02.165-1 -> 2.02.166-1)
[2016-10-06 15:56] [ALPM] upgraded mariadb-clients (10.1.17-1 -> 10.1.18-1)
[2016-10-06 15:56] [ALPM] upgraded mariadb (10.1.17-1 -> 10.1.18-1)
[2016-10-06 15:56] [ALPM] upgraded modemmanager (1.6.0-1 -> 1.6.2-1)
[2016-10-06 15:56] [ALPM] upgraded networkmanager (1.4.1dev+33+gc87b89b-1 -> 1.4.2-1)
[2016-10-06 15:57] [ALPM] upgraded nmap (7.12-2 -> 7.30-1)
[2016-10-06 15:57] [ALPM] upgraded openssh (7.3p1-1 -> 7.3p1-2)
[2016-10-06 15:57] [ALPM] upgraded pacman-mirrorlist (20160913-1 -> 20161005-1)
[2016-10-06 15:58] [ALPM] upgraded python-setuptools (1:27.3.0-1 -> 1:28.1.0-1)
[2016-10-06 15:58] [ALPM] upgraded python2-setuptools (1:27.3.0-1 -> 1:28.1.0-1)
[2016-10-06 15:58] [ALPM] upgraded qca-qt5 (2.1.1-5 -> 2.1.1-6)
[2016-10-06 15:58] [ALPM] upgraded qt5-xmlpatterns (5.7.0-1 -> 5.7.0-2)
[2016-10-06 15:58] [ALPM] upgraded qt5-declarative (5.7.0-2 -> 5.7.0-3)
[2016-10-06 15:58] [ALPM] upgraded qt5-tools (5.7.0-1 -> 5.7.0-2)
[2016-10-06 15:58] [ALPM] upgraded rtkit (0.11-5 -> 0.11+6+g417bb7d-1)
[2016-10-06 15:58] [ALPM] upgraded smplayer (16.8.0-1 -> 16.9.0-1)
[2016-10-06 15:58] [ALPM] upgraded sudo (1.8.17.p1-1 -> 1.8.18-1)
[2016-10-06 15:58] [ALPM] upgraded systemd-sysvcompat (231-1 -> 231-3)
[2016-10-06 15:58] [ALPM] upgraded thunderbird (45.3.0-1 -> 45.4.0-1)
[2016-10-06 15:58] [ALPM] upgraded vim-runtime (8.0.0005-1 -> 8.0.0013-1)
[2016-10-06 15:58] [ALPM] upgraded vim (8.0.0005-1 -> 8.0.0013-1)
[2016-10-06 15:58] [ALPM] upgraded wireshark-cli (2.2.0-1 -> 2.2.0-2)
[2016-10-06 15:58] [ALPM] upgraded wireshark-common (2.2.0-1 -> 2.2.0-2)
[2016-10-06 15:58] [ALPM] upgraded wireshark-qt (2.2.0-1 -> 2.2.0-2)
[2016-10-06 15:58] [ALPM] upgraded xf86-input-evdev (2.10.3-1 -> 2.10.4-1)
[2016-10-06 15:58] [ALPM] upgraded xf86-video-intel (1:2.99.917+703+g15c5ff1-1 -> 1:2.99.917+708+g8f33f80-1)
[2016-10-06 15:58] [ALPM] upgraded xterm (325-1 -> 326-1)
[[email protected] ~]$
2. 在linux这条路上,遇见此类问题是难以避免的。总的结论就是问题解决了,然而我却并不明确的知道如何解决的。而且也不需要深究。
但是,一个指导性的建议就是,应该对这种故障拥有备份机制。即需要一套稳定性高的基础性工具包,来在故障发生时可以继续常规工作。如:FVWM+basic xorg tools。
之前切到kde之后,我就把FVWM都卸载了,现在看来需要重新安装一套了。以用于灾难恢复。
以上是关于[troubleshoot][archlinux][X] plasma(KDE) 窗口滚动刷新冻结(约延迟10s)(已解决,root cause不明,无法再次复现)的主要内容,如果未能解决你的问题,请参考以下文章
一篇有情绪的 go troubleshooting guide