Bug 44878 - make-initrd: медленная загрузка
Summary: make-initrd: медленная загрузка
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: make-initrd (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Alexey Gladkov
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-10 19:14 MSK by Alexey Sheplyakov
Modified: 2023-01-10 23:08 MSK (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Sheplyakov 2023-01-10 19:14:42 MSK
С момента запуска /init в initramfs до запуска /sbin/init в корневой ФС проходит 18 секунд.
Измерял по логу ядра

[    8.534019] Freeing unused kernel memory: 3776K
[    8.534741] Run /init as init process
[    8.534875]   with arguments:
[    8.534985]     /init
[    8.535086]   with environment:
[    8.535196]     HOME=/
[    8.535297]     TERM=linux
[    8.535402]     BOOT_IMAGE=/boot/vmlinuz-6.2.0-rc3-00042-g379ba1775010
[    8.672904] input: Logitech USB Keyboard as /devices/platform/soc/soc:usb2@2c400000/2c400000.dwc3/xhci-hcd.1.auto/usb1/1-1/1-1:1.0/0003:046D:C31C.0001/input/input1
[    8.726275] hid-generic 0003:046D:C31C.0001: input,hidraw0: USB HID v1.10 Keyboard [Logitech USB Keyboard] on usb-xhci-hcd.1.auto-1/input0
[    8.735845] input: Logitech USB Keyboard Consumer Control as /devices/platform/soc/soc:usb2@2c400000/2c400000.dwc3/xhci-hcd.1.auto/usb1/1-1/1-1:1.1/0003:046D:C31C.0002/input/input2
[    8.788455] input: Logitech USB Keyboard System Control as /devices/platform/soc/soc:usb2@2c400000/2c400000.dwc3/xhci-hcd.1.auto/usb1/1-1/1-1:1.1/0003:046D:C31C.0002/input/input3
[    8.789611] hid-generic 0003:046D:C31C.0002: input,hidraw1: USB HID v1.10 Device [Logitech USB Keyboard] on usb-xhci-hcd.1.auto-1/input1
[    8.904776] usb 1-2: new low-speed USB device number 3 using xhci-hcd
[    9.179827] input: PixArt USB Optical Mouse as /devices/platform/soc/soc:usb2@2c400000/2c400000.dwc3/xhci-hcd.1.auto/usb1/1-2/1-2:1.0/0003:093A:2510.0003/input/input4
[    9.181333] hid-generic 0003:093A:2510.0003: input,hidraw2: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-xhci-hcd.1.auto-2/input0
[   18.442974] NET: Registered PF_INET6 protocol family
[   18.446934] Segment Routing with IPv6
[   18.447131] In-situ OAM (IOAM) with IPv6
[   19.951106] EXT4-fs (sda2): mounted filesystem 14fe396a-85e4-4fc0-a833-7837552a772b with ordered data mode. Quota mode: none.
[   26.903958] systemd[1]: systemd v249.12-alt3 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS -FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)


На этой же плате (с этим же ядром) при использовании dracut initramfs завершает работу за 1,6 секунд:

[    8.598568] Freeing unused kernel memory: 3776K
[    8.599274] Run /init as init process
[    8.599409]   with arguments:
[    8.599520]     /init
[    8.599620]   with environment:
[    8.599730]     HOME=/
[    8.599832]     TERM=linux
[    8.599937]     BOOT_IMAGE=/boot/vmlinuz-6.2.0-rc3-00042-g379ba1775010
[    8.745826] input: Logitech USB Keyboard as /devices/platform/soc/soc:usb2@2c400000/2c400000.dwc3/xhci-hcd.1.auto/usb1/1-1/1-1:1.0/0003:046D:C31C.0001/input/input1
[    8.799464] hid-generic 0003:046D:C31C.0001: input,hidraw0: USB HID v1.10 Keyboard [Logitech USB Keyboard] on usb-xhci-hcd.1.auto-1/input0
[    8.808701] input: Logitech USB Keyboard Consumer Control as /devices/platform/soc/soc:usb2@2c400000/2c400000.dwc3/xhci-hcd.1.auto/usb1/1-1/1-1:1.1/0003:046D:C31C.0002/input/input2
[    8.861031] input: Logitech USB Keyboard System Control as /devices/platform/soc/soc:usb2@2c400000/2c400000.dwc3/xhci-hcd.1.auto/usb1/1-1/1-1:1.1/0003:046D:C31C.0002/input/input3
[    8.862309] hid-generic 0003:046D:C31C.0002: input,hidraw1: USB HID v1.10 Device [Logitech USB Keyboard] on usb-xhci-hcd.1.auto-1/input1
[    8.948977] NET: Registered PF_INET6 protocol family
[    8.952811] Segment Routing with IPv6
[    8.953011] In-situ OAM (IOAM) with IPv6
[    8.977186] usb 1-2: new low-speed USB device number 3 using xhci-hcd
[    9.038977] systemd[1]: systemd v249.12-alt3 running in system mode (+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS -FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY -P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[    9.042624] systemd[1]: Detected architecture arm64.


А через 25 секунд после старта ядра уже запущен lightdm (т.е загрузка в 1,7 раз быстрее).
При загрузке по сети, использовании luks, initramfs (созданный make-initrd) работает ещё медленнее (раза в 3 -- 4).
Comment 1 Alexey Gladkov 2023-01-10 19:21:00 MSK
Слишком мало данных.

На чём корневой раздел ?
Какие параметры переданы при загрузке ?
Comment 2 Alexey Sheplyakov 2023-01-10 19:25:24 MSK
(Ответ для Alexey Gladkov на комментарий #1)
> Слишком мало данных.
> 
> На чём корневой раздел ?

# lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 238,5G  0 disk 
├─sda1   8:1    0   255M  0 part /boot/efi
├─sda2   8:2    0    32G  0 part /
├─sda3   8:3    0     4G  0 part [SWAP]
└─sda4   8:4    0 202,2G  0 part /home

> Какие параметры переданы при загрузке ?

$ cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-6.2.0-rc3-00042-g379ba1775010 root=UUID=14fe396a-85e4-4fc0-a833-7837552a772b ro audit=0
Comment 3 Alexey Gladkov 2023-01-10 19:33:50 MSK
Хм. Вроде простая конфигурация.
Comment 4 Alexey Gladkov 2023-01-10 23:08:34 MSK
Пока у меня нет конкретных идей по оптимизации. Оставлю багу открытой и буду её иметь в виду.