Linuxカーネルの起動時間が大幅に増加しました。これを調べる方法は?

Linuxカーネルの起動時間が大幅に増加しました。これを調べる方法は?

カーネル 4.5 から起動時間が 900 ミリ秒 (4.4.44) から 2.1 秒 (4.9.5) に増えます。

適切なバグレポートを開いて修正したり、少なくとも開発者に役立つことを望んでいますが、役に立つレポートを作成するには、どの情報を提供するのかわかりません。

では、このカーネルの起動時間の問題をどのように調べますか?

ポリスチレン:私はArch Linux x86_64とGnomeと一緒にDell XPS 9343(Broadwell)を使用しています。
PS2:実際にはシステムにLTSカーネル(4.4.44)と-ck(4.9.5)がインストールされており、systemd-bootメニューからそれを選択し、上記の時間は次のコマンドから取得されますsystemd-analyzeコア入り口。
PS3:開始時間の増加を検出(および測定)しながら終了したときも同じ現象を検出しましたが、この場合はこれをどのように測定するのかわかりません。

編集1: カーネル 4.9 から出力を要求します。

[mattia@arch-xps ~]$ systemd-analyze blame
          2.356s dev-sda3.device
          1.648s systemd-fsck@dev-disk-by\x2duuid-88E7\x2d8ACB.service
          1.646s systemd-fsck@dev-disk-by\x2duuid-e2a87acb\x2d9e12\x2d4501\x2dbb
          1.346s tlp.service
          1.324s systemd-journald.service
          1.307s systemd-udev-trigger.service
          1.306s systemd-tmpfiles-setup-dev.service
          1.296s colord.service
          1.005s systemd-journal-flush.service
           947ms [email protected]
           944ms systemd-timesyncd.service
           854ms accounts-daemon.service
           564ms systemd-rfkill.service
           244ms org.cups.cupsd.service
           163ms packagekit.service
            89ms NetworkManager.service
            86ms bluetooth.service
            75ms systemd-logind.service
            53ms upower.service
            53ms [email protected]
            49ms polkit.service
            43ms systemd-udevd.service
            38ms wpa_supplicant.service
            36ms udisks2.service
            28ms systemd-sysctl.service
            25ms systemd-tmpfiles-clean.service
            22ms boot.mount
            20ms systemd-random-seed.service
            19ms gdm.service
            16ms geoclue.service
            16ms systemd-backlight@leds:dell::kbd_backlight.service
            14ms kmod-static-nodes.service
            13ms systemd-remount-fs.service
            11ms dev-sda2.swap
            11ms dev-mqueue.mount
            10ms systemd-tmpfiles-setup.service
            10ms sys-kernel-debug.mount
             8ms systemd-backlight@backlight:intel_backlight.service
             7ms home.mount
             6ms systemd-update-utmp.service
             6ms sys-kernel-config.mount
             6ms systemd-user-sessions.service
             5ms dev-hugepages.mount
             5ms rtkit-daemon.service
             3ms sys-fs-fuse-connections.mount
             3ms tmp.mount

[mattia@arch-xps ~]$ systemd-analyze critical-chain 
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @5.282s
└─gdm.service @5.258s +19ms
  └─systemd-user-sessions.service @5.244s +6ms
    └─nss-user-lookup.target @5.288s

編集2:カーネル4.4からの出力要求

[mattia@arch-xps ~]$ systemd-analyze blame
          1.356s systemd-fsck@dev-disk-by\x2duuid-e2a87acb\x2d9e12\x2d4501\x2dbb
          1.355s systemd-rfkill.service
           895ms [email protected]
           861ms tlp.service
           474ms dev-sda3.device
           379ms systemd-localed.service
           310ms systemd-hostnamed.service
           310ms systemd-timedated.service
           255ms systemd-timesyncd.service
           188ms org.cups.cupsd.service
           146ms systemd-journald.service
           112ms packagekit.service
            60ms bluetooth.service
            60ms NetworkManager.service
            59ms accounts-daemon.service
            58ms upower.service
            49ms systemd-udevd.service
            48ms systemd-fsck@dev-disk-by\x2duuid-88E7\x2d8ACB.service
            37ms [email protected]
            36ms polkit.service
            33ms systemd-udev-trigger.service
            25ms systemd-journal-flush.service
            24ms systemd-tmpfiles-setup-dev.service
            22ms udisks2.service
            17ms gdm.service
            16ms kmod-static-nodes.service
            16ms dev-sda2.swap
            16ms boot.mount
            15ms colord.service
            15ms sys-kernel-debug.mount
            13ms systemd-remount-fs.service
            13ms dev-hugepages.mount
            13ms geoclue.service
            13ms systemd-sysctl.service
            13ms home.mount
            10ms systemd-logind.service
             9ms sys-kernel-config.mount
             8ms wpa_supplicant.service
             8ms systemd-tmpfiles-setup.service
             7ms systemd-random-seed.service
             7ms systemd-backlight@leds:dell::kbd_backlight.service
             5ms systemd-update-utmp.service
             5ms rtkit-daemon.service
             4ms systemd-user-sessions.service
             4ms tmp.mount
             3ms systemd-backlight@backlight:intel_backlight.service
             3ms dev-mqueue.mount
             2ms sys-fs-fuse-connections.mount

[mattia@arch-xps ~]$ systemd-analyze critical-chain 
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @2.555s
└─gdm.service @2.536s +17ms
  └─systemd-user-sessions.service @2.525s +4ms
    └─nss-user-lookup.target @2.559s

編集3:いいえ、サイズはほぼ同じです。

[mattia@arch-xps ~]$ ls /boot/
total 62M
drwxr-xr-x  5 root root 4.0K Jan  1  1970 .
drwxr-xr-x 17 root root 4.0K Dec 10 17:31 ..
drwxr-xr-x  6 root root 4.0K Dec 14 17:49 EFI
drwxr-xr-x  2 root root 4.0K Jan 11 16:39 grub
drwxr-xr-x  3 root root 4.0K May 14  2016 loader
-rwxr-xr-x  1 root root  21M Jan 20 15:40 initramfs-linux-ck-fallback.img
-rwxr-xr-x  1 root root 5.7M Jan 20 15:40 initramfs-linux-ck.img
-rwxr-xr-x  1 root root  20M Jan 17 18:01 initramfs-linux-lts-fallback.img
-rwxr-xr-x  1 root root 5.6M Jan 17 18:01 initramfs-linux-lts.img
-rwxr-xr-x  1 root root 961K Nov 15 18:43 intel-ucode.img
-rwxr-xr-x  1 root root 4.6M Jan 20 15:38 vmlinuz-linux-ck
-rwxr-xr-x  1 root root 4.3M Jan 15 15:05 vmlinuz-linux-lts

編集4:公式リポジトリのカーネルを使ってみました(6番目と7番目のコメントを参照)。起動時間は1.3秒と大きく異なりますが、まだカーネル4.4よりも高いです。

[mattia@arch-xps ~]$ systemd-analyze blame
          1.979s dev-sda3.device
          1.369s systemd-journald.service
          1.347s colord.service
           871ms systemd-udev-trigger.service
           868ms [email protected]
           868ms systemd-tmpfiles-setup-dev.service
           793ms systemd-udevd.service
           782ms tlp.service
           508ms systemd-timesyncd.service
           503ms [email protected]
           473ms wpa_supplicant.service
           177ms org.cups.cupsd.service
           110ms packagekit.service
            85ms NetworkManager.service
            85ms systemd-journal-flush.service
            66ms systemd-fsck@dev-disk-by\x2duuid-e2a87acb\x2d9e12\x2d4501\x2dbb
            49ms upower.service
            47ms systemd-fsck@dev-disk-by\x2duuid-88E7\x2d8ACB.service
            44ms accounts-daemon.service
            28ms bluetooth.service
            27ms polkit.service
            24ms gdm.service
            22ms udisks2.service
            18ms systemd-rfkill.service
            16ms systemd-logind.service
            15ms geoclue.service
            13ms boot.mount
            13ms dev-hugepages.mount
            12ms dev-mqueue.mount
            11ms systemd-remount-fs.service
            11ms systemd-backlight@leds:dell::kbd_backlight.service
            11ms systemd-sysctl.service
            10ms sys-kernel-config.mount
             9ms dev-sda2.swap
             9ms kmod-static-nodes.service
             8ms systemd-user-sessions.service
             7ms home.mount
             7ms systemd-backlight@backlight:intel_backlight.service
             7ms systemd-tmpfiles-setup.service
             6ms systemd-update-utmp.service
             5ms tmp.mount
             5ms systemd-random-seed.service
             4ms rtkit-daemon.service
             4ms sys-fs-fuse-connections.mount
             2ms sys-kernel-debug.mount
[mattia@arch-xps ~]$ systemd-analyze critical-chain 
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @4.604s
└─gdm.service @4.397s +24ms
  └─systemd-user-sessions.service @4.379s +8ms
    └─nss-user-lookup.target @4.425s

ベストアンサー1

おすすめ記事