Ubuntu Rethinking Its Initramfs Compression Strategy

Ubuntu had switched from LZ4 at its maximum compression level of 9 to going with Zstd, which is wonderful, and has a maximum level of 19. But with that highest compression level they have found the initramfs decompression to be too slow and consumes too much memory. In particular, for low-end devices and embedded hardware like the Raspberry Pi Zero with just 512MB of RAM, it just crashes.
Ubuntu developers thus have been re-evaluating their Zstd compression level and looking at the time/compression/filesize impact with lowering the compression level.
Current thinking expressed by Canonical's Julian Andres Klode is to use the lowest level of one for hardware with 512MB or less, some compression level for other hardware, and Zstd 19 for image building. Finding the right mix in between for the proper memory / performance / time trade-off is still being determined but should be sorted out well in time for Ubuntu 22.04 LTS.
The current state of this initramfs compression evaluation was laid out on ubuntu-devel.
40 Comments