Hi On Tue, Feb 1, 2022 at 6:54 AM Tobias Powalowski via arch-dev-public < arch-dev-public@lists.archlinux.org> wrote:
Hi guys, did some initcpio optimizing lately and implemented correct symlink handling. This saves already some space. https://bugs.archlinux.org/task/73439
Now one major problem left in recent initcpio, uncompressed modules: https://github.com/archlinux/mkinitcpio/pull/25 https://bugs.archlinux.org/task/72882 At the moment modules are uncompressed during initcpio creation. This leads to bigger RAM usage during boot, makes it a bit smaller on storage, due to not recompress compressed modules. On small initrds for normal boot this is not a big matter.
My measurement with all patches added: Ramdisk size uncompressed modules: 13261677 Ramdisk size compressed modules: 13112083 (Note the compressed one is smaller due to the symlink patches added) Unpacked initramfs uncompressed modules: 35 MB Unpacked initramfs compressed modules: 26 MB
This memory usage difference does not make much difference for the boot experience. Keep in mind that it is initramfs stage and all the memory used here (except a tiny part) is reclaimed/freed at the end of initramfs. So this memory difference is just a blip at the first 100ms of the boot process when no OS/services are loaded and no memory pressure exists. The drawback of this solution is that kernel modules are double-compressed - the first time with initramfs and then module compression itself. And decompressing requires extra time that is probably more valuable at initramfs stage. What is the reported systemd-analyze time for compressed vs non-compressed versions?
Using this on the biggest "initramfs testsuite" archboot shows the most advantages.
If you like to test it on your own initramfs setup you can use:
https://gitlab.archlinux.org/tpowa/archboot/-/blob/master/usr/share/archboot... for /usr/lib/initcpio/functions and recreate your initramdisk.
Now my question to the list, what should be the default how arch handles modules in initramfs? - Shall we leave the modules at compression level used during kernel build? --> This means the uncompression should be optional. - Shall we still uncompress the modules always? (Status now) --> Then using modules as is needs to be optional.
Thanks for you input. greetings tpowa -- Tobias Powalowski Archlinux Developer & Package Maintainer (tpowa) https://www.archlinux.org <http://www.archlinux.org> tpowa@archlinux.org
St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de info@st-martin-apo.de