[Bug 2065180] Re: performance regression in dracut-install 060
Benjamin Drung
2065180 at bugs.launchpad.net
Mon Jul 1 18:10:43 UTC 2024
There are 51 dracut-install calls on my Raspberry Pi Zero 2W on Ubuntu
24.04:
```
dracut-install -m -P /hid-(a4tech|cypress|dr|elecom|gyration|icade|kensington|kye|lcpower|magicmouse|ntrig|petalynx|picolcd|pl|ps3remote|quanta|roccat-ko.*|roccat-pyra|saitek|sensor-hub|sony|speedlink|tivo|twinhan|uclogic|wacom|waltop|wiimote|zydacron|.*ff)\.ko =drivers/hid
dracut-install -m =drivers/usb/host -P /(hwa-hc|sl811_cs|sl811-hcd|u132-hcd|whci-hcd)\.ko
dracut-install -m -P /((cdc_mbim|ipheth|qmi_wwan|sierra_net|veth|xen-netback)\.ko|(isdn|net/ethernet|net/phy|net/team|uwb|wan|wireless)/) -s eth_type_trans|register_virtio_device|usbnet_open =drivers/net
dracut-install -m -s ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_mq_alloc_request|blk_mq_destroy_queue|blk_cleanup_disk|dw_mc_probe|dw_mci_pltfm_register|nvme_init_ctrl|iscsi_register_transport =drivers/scsi =drivers/ufs
dracut-install -m -s ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_mq_alloc_request|blk_mq_destroy_queue|blk_cleanup_disk|dw_mc_probe|dw_mci_pltfm_register|nvme_init_ctrl =drivers/block =drivers/nvme =drivers/dax vmd
dracut-install -m -s nvdimm_bus_register =drivers/nvdimm =drivers/acpi
dracut-install -m -s ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_mq_alloc_request|blk_mq_destroy_queue|blk_cleanup_disk|dw_mc_probe|dw_mci_pltfm_register|nvme_init_ctrl =drivers/ata
dracut-install -m btrfs ext2 ext3 ext4 f2fs isofs jfs reiserfs squashfs udf xfs nfs nfsv2 nfsv3 nfsv4 af_packet atkbd i8042 psmouse virtio_pci virtio_mmio vfat nls_cp437 nls_iso8859-1 ehci-hcd ehci-pci ehci-platform ohci-hcd ohci-pci uhci-hcd usbhid xhci-hcd xhci-pci xhci-plat-hcd =drivers/usb/typec =drivers/usb/c67x00 =drivers/usb/renesas_usbhs extcon-usb-gpio extcon-usbc-cros-ec =drivers/input/keyboard cros_ec_spi intel_lpss_pci spi_pxa2xx_platform surface_aggregator_registry =drivers/tty/serial =drivers/bus =drivers/i2c/muxes =drivers/pci/controller =drivers/pinctrl =drivers/clk =drivers/i2c/busses =drivers/gpio =drivers/mfd =drivers/nvmem =drivers/phy =drivers/power =drivers/regulator =drivers/reset =drivers/spi =drivers/spmi =drivers/soc =drivers/usb/chipidea =drivers/usb/dwc2 =drivers/usb/dwc3 =drivers/usb/isp1760 =drivers/usb/musb =drivers/usb/phy =drivers/rtc axp20x_usb_power =drivers/char/hw_random =drivers/net/ethernet =drivers/net/mdio =drivers/net/phy 8021q ipvlan =drivers/ide be2iscsi bnx2i cxgb3i cxgb4i qedi qla4xxx scsi_dh_alua scsi_dh_emc scsi_dh_rdac mptfc mptsas mptscsih mptspi zfcp scsi_transport_srp dax_pmem nd_pmem dasd_diag_mod dasd_eckd_mod dasd_fba_mod firewire-ohci firewire-sbp2 =drivers/mmc =drivers/usb/storage rockchipdrm pwm-cros-ec pwm_bl pwm-rockchip panel-simple analogix-anx6345 pwm-sun4i sun4i-drm sun8i-mixer panel-edp pwm_imx27 nwl-dsi ti-sn65dsi86 imx-dcss mux-mmio mxsfb imx8mq-interconnect hv_vmbus hv_utils hv_netvsc hv_mouse hv_storvsc hyperv-keyboard nx-compress nx-compress-crypto nx-compress-platform nx-compress-pseries nx-compress-powernv 842-decompress
dracut-install -m crc32c vmd mlx5_ib mlx4_ib crc32c crc32
dracut-install -m dm_mod
dracut-install -m dm_crypt
dracut-install -m sm3-ce ghash-ce aes-ce-ccm sm4-ce-cipher aes-neon-blk sm4-ce aes-ce-cipher sha2-ce aes-arm64 chacha-neon aes-ce-blk sha256-arm64 sha512-ce aes-neon-bs sha512-arm64 sha3-ce poly1305-neon sha1-ce sm4-neon sm3-neon polyval-ce crct10dif-ce nhpoly1305-neon sm4-ce-gcm sm4-ce-ccm
dracut-install -m blowfish_generic cts algif_hash algif_aead chacha_generic cmac chacha20poly1305 polyval-generic xcbc ansi_cprng blowfish_common ccm 842 xts ecdh_generic ecc gcm hctr2 lrw pkcs8_key_parser pkcs7_test_key xor des_generic authenc sm4_generic twofish_common fcrypt sm4 ecrdsa_generic pcbc tcrypt cast5_generic aria_generic af_alg lz4hc adiantum zstd poly1305_generic crypto_engine michael_mic crypto_null xctr algif_skcipher sm3_generic cast6_generic cast_common md4 curve25519-generic cryptd camellia_generic seqiv keywrap xxhash_generic streebog_generic aegis128 aes_ti authencesn nhpoly1305 serpent_generic async_tx async_xor async_raid6_recov async_pq async_memcpy geniv essiv crypto_user algif_rng echainiv rmd160 ghash-generic lz4 crc32_generic pcrypt twofish_generic sm2_generic vmac ecdsa_generic blake2b_generic sm3 wp512
dracut-install -m -s drm_privacy_screen_register =drivers/platform/x86
dracut-install -m efifb fbcon simplefb vesafb vga16fb =drivers/gpu/drm/tiny vboxvideo virtio-gpu
dracut-install -m fuse
dracut-install -m dm-cache
dracut-install -m dm-cache-smq
dracut-install -m dm-thin-pool
dracut-install -m overlayfs
dracut-install -m overlay
dracut-install -m dm_mod
dracut-install -m dm_crypt
dracut-install -m aesni_intel
dracut-install -m linear
dracut-install -m multipath
dracut-install -m raid0
dracut-install -m raid1
dracut-install -m raid456
dracut-install -m raid5
dracut-install -m raid6
dracut-install -m raid10
dracut-install -m dm_mod
dracut-install -m dm_snapshot
dracut-install -m dm_mirror
dracut-install -m dm_raid
dracut-install -m raid0
dracut-install -m raid1
dracut-install -m raid10
dracut-install -m raid456
dracut-install -m crc32c
dracut-install -m libcrc32c
dracut-install -m ib_iser
dracut-install -m iscsi_tcp
dracut-install -m libiscsi
dracut-install -m scsi_transport_iscsi
dracut-install -m iscsi_ibft
dracut-install -m cxgb3i
dracut-install -m cxgb4i
dracut-install -m dm_mod
dracut-install -m bcache
```
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dracut in Ubuntu.
Matching subscriptions: dracut
https://bugs.launchpad.net/bugs/2065180
Title:
performance regression in dracut-install 060
Status in Dracut:
New
Status in cryptsetup package in Ubuntu:
Fix Released
Status in dracut package in Ubuntu:
Fix Released
Status in initramfs-tools package in Ubuntu:
Fix Released
Status in lvm2 package in Ubuntu:
Fix Released
Status in miniramfs package in Ubuntu:
Fix Released
Status in thin-provisioning-tools package in Ubuntu:
Fix Released
Status in cryptsetup source package in Noble:
New
Status in dracut source package in Noble:
Fix Released
Status in initramfs-tools source package in Noble:
Incomplete
Status in lvm2 source package in Noble:
New
Status in miniramfs source package in Noble:
New
Status in thin-provisioning-tools source package in Noble:
New
Bug description:
[ Impact ]
When compared to Ubuntu 23.10, creating intramfs files with update-
initramfs takes 2 to 5 times more time on ARM devices.
IIUC, dracut-install usage was added to initramfs-tools to speed up
the process. But now its way slower. Even running update-initramfs on
jammy, which doesn't use dracut-install, is way faster then the time
taken on Noble.
first bad commit -
https://github.com/dracutdevs/dracut/commit/3de4c7313260fb600507c9b87f780390b874c870
Updating the initrd on a Raspberry Pi Zero 2W on Ubuntu 24.04 (noble)
with initramfs-tools 0.142ubuntu25.1 takes over six minutes:
```
bdrung at zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
Time (mean ± σ): 402.751 s ± 5.592 s [User: 166.316 s, System: 228.909 s]
Range (min … max): 394.380 s … 411.445 s 10 runs
```
[ Test Plan ]
1. Measure `update-initramfs -u` before the update.
2. Log the content of the initrd before the update: `lsinitramfs /boot/initrd.img`
3. update dracut-install / initramfs-tools-core
4. Measure `update-initramfs -u`. It should be faster (the performance improvements on amd64 should be very small and might be within the measurement uncertainty).
5. Check with lsinitramfs that the content of the newly generated initrd hasn't changed.
[ Where problems could occur ]
The code that is responsible for including the kernel modules into the
initrd is touched. Negative consequences could be that some needed
kernel modules will not be included any more (should be covered by the
test case) or that building new initrds will fail.
The initramfs-tools fix changes how manual_add_modules behaves.
`manual_add_modules` does not copy kernel modules, but queues them for
being copied when the newly added function `apply_add_modules` is
called.
I checked all instances of calls to `manual_add_modules` for possible
regressions (see comment #15). Only miniramfs needs to be adjusted to
also call `apply_add_modules`. But this change could break consumers
of the `manual_add_modules` function that are outside of the Ubuntu
archive. I googled for `apply_add_modules` but found no public outside
users.
[ Benchmarks ]
Stock noble on a Raspberry Pi Zero 2W:
```
bdrung at zero2w:~$ sudo hyperfine -r 5 "update-initramfs -u"
Benchmark 1: update-initramfs -u
Time (mean ± σ): 415.664 s ± 6.015 s [User: 166.728 s, System: 232.523 s]
Range (min … max): 409.139 s … 422.632 s 5 runs
```
noble with dracut-install 060+5-1ubuntu3.1 (with linux 6.8.0-1006.6 on
2024-07-01):
```
bdrung at zero2w:~$ sudo hyperfine --warmup 1 -r 10 "update-initramfs -u"
Benchmark 1: update-initramfs -u
Time (mean ± σ): 248.054 s ± 5.569 s [User: 67.410 s, System: 169.412 s]
Range (min … max): 238.909 s … 257.384 s 10 runs
```
[ Other Info ]
$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu 24.04 LTS
Release: 24.04
$ apt-cache policy dracut-install
dracut-install:
Installed: 060+5-1ubuntu3
Candidate: 060+5-1ubuntu3
Version table:
*** 060+5-1ubuntu3 500
500 http://ports.ubuntu.com/ubuntu-ports noble/main arm64 Packages
100 /var/lib/dpkg/status
To manage notifications about this bug go to:
https://bugs.launchpad.net/dracut/+bug/2065180/+subscriptions
More information about the foundations-bugs
mailing list