lightdm waits for plymouth-quit-wait to release display resources

lightdm.service waits for plymouth-quit-wait.service to release display resources

plymouth

安装plymouth-dbgsym

1
2
3
4
5
6
7
8
9
apt policy plymouth
plymouth:
已安装:0.9.4.2-1+dde
候选: 0.9.4.2-1+dde
版本列表:
*** 0.9.4.2-1+dde 500
500 http://pools.uniontech.com/desktop-professional eagle/main amd64 Packages
500 https://professional-security.chinauos.com eagle/1070/main amd64 Packages
100 /usr/lib/dpkg-db/status
1
2
3
4
5
6
7
8
apt policy plymouth-dbgsym 
plymouth-dbgsym:
已安装:(无)
候选: 0.9.4.2-1+dde
版本列表:
0.9.4.2-1+dde 500
500 http://pools.uniontech.com/desktop-professional eagle/main amd64 Packages
500 https://professional-security.chinauos.com eagle/1070/main amd64 Packages

源码编译plymouth deb包

1
apt source plymouth
1
cd plymouth-0.9.4.2/
1
sudo apt build-dep .
1
dpkg-buildpackage -b -uc -us -j16
1
2
3
4
5
6
7
8
9
10
11
find . -name plymouth -type f
./debian/tmp/bin/plymouth
./debian/plymouth/etc/init.d/plymouth
./debian/plymouth/usr/share/lintian/overrides/plymouth
./debian/plymouth/usr/share/initramfs-tools/scripts/init-premount/plymouth
./debian/plymouth/usr/share/initramfs-tools/scripts/init-bottom/plymouth
./debian/plymouth/usr/share/initramfs-tools/scripts/panic/plymouth
./debian/plymouth/usr/share/initramfs-tools/hooks/plymouth
./debian/plymouth/bin/plymouth
./src/client/.libs/plymouth
./src/client/plymouth
1
2
file ./src/client/plymouth
./src/client/plymouth: Bourne-Again shell script, ASCII text executable

表明./src/client/plymouth不是要找的plymouth二进制elf文件。

1
2
file ./src/client/.libs/plymouth
./src/client/.libs/plymouth: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=56e45102a96d8f5a947ca80ed6267b917dee0e57, with debug_info, not stripped

表明./src/client/.libs/plymouth就是要找的plymouth二进制elf文件。

可以使用readelf命进一步确认:

1
2
3
4
5
6
7
8
readelf -S src/client/.libs/plymouth | grep -i debug
[27] .debug_aranges PROGBITS 0000000000000000 0000b252
[28] .debug_info PROGBITS 0000000000000000 0000b2c2
[29] .debug_abbrev PROGBITS 0000000000000000 000141e6
[30] .debug_line PROGBITS 0000000000000000 00014b34
[31] .debug_str PROGBITS 0000000000000000 00018587
[32] .debug_loc PROGBITS 0000000000000000 00019dfc
[33] .debug_ranges PROGBITS 0000000000000000 00021f45

plymouth-start.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cat /lib/systemd/system/plymouth-start.service
[Unit]
Description=Show Plymouth Boot Screen
DefaultDependencies=no
Wants=systemd-ask-password-plymouth.path systemd-vconsole-setup.service
After=systemd-vconsole-setup.service systemd-udev-trigger.service systemd-udevd.service
Before=systemd-ask-password-plymouth.service
ConditionKernelCommandLine=!plymouth.enable=0
ConditionVirtualization=!container

[Service]
ExecStart=/sbin/plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session
ExecStartPost=-/bin/plymouth show-splash
Type=forking
RemainAfterExit=yes
KillMode=none
SendSIGKILL=no

plymouthd作为daemon服务,plymouth作为前台进程。

grub

修改前的/etc/default/grub:

1
2
3
4
5
6
7
8
9
10
cat /etc/default/grub
# Generated by deepin-installer
GRUB_BACKGROUND="/boot/grub/themes/deepin-fallback/background.jpg"
GRUB_CMDLINE_LINUX_DEFAULT="video=efifb:nobgrt splash quiet "
GRUB_DEFAULT=0
GRUB_DISTRIBUTOR="`/usr/bin/lsb_release -d -s 2>/dev/null || echo UOS 20`"
GRUB_THEME="/boot/grub/themes/deepin-fallback/theme.txt"
GRUB_TIMEOUT=1
GRUB_GFXMODE=auto
DEEPIN_GFXMODE_DETECT=1

修改后的/etc/default/grub:

1
2
3
4
5
6
7
8
9
10
cat /etc/default/grub
# Generated by deepin-installer
GRUB_BACKGROUND="/boot/grub/themes/deepin-fallback/background.jpg"
GRUB_CMDLINE_LINUX_DEFAULT="video=efifb:nobgrt quiet plymouth:debug systemd.log_level=debug locales=zh_CN.UTF-8"
GRUB_DEFAULT=0
GRUB_DISTRIBUTOR="`/usr/bin/lsb_release -d -s 2>/dev/null || echo UOS 20`"
GRUB_THEME="/boot/grub/themes/deepin-fallback/theme.txt"
GRUB_TIMEOUT=1
GRUB_GFXMODE=auto
DEEPIN_GFXMODE_DETECT=1

grub中去掉splash参数后,plymouth相关的4个systemd服务依然会启动,只是不会展示log而已。

grub中增加参数plymouth:debug,将log打印到控制台,进入系统后可以直接查看var/log/plymouth-debug.log日志。

grub中增加参数增加systemd.log_level=debug,将systemd日志级别调整为debug。

plymouth-debug.log

plymouth从00:00:01.676跑到00:00:48.567才释放资源,lightdm自然无法送显示。

plymouth-debug

systemd-update-utmp.service

systemd-update-utmp.service

systemd-update-utmp.service 慢了接近4s,这是一个前置服务,会阻塞后面所有流程

windbind.service

windbind.service
20240322171122
20240322171141

plymouth会通过一号进程systemd关注windbind.service状态,1070上的windbind.service比1060上的多跑了11.7秒。

lightdm.service

20240322171231
20240322171237

plymouth会关注lightdm fork出来的进程plymouth quit --retain-splash,1070这里lightdm 慢了接近9.5秒。


lightdm waits for plymouth-quit-wait to release display resources
https://realwujing.github.io/linux/kernel/bugs/perf/243205/lightdm waits for plymouth-quit-wait to release display resources/
作者
Wu Jing
发布于
2024年7月26日
许可协议