Ubuntu Moving Ahead With Compressing Their Kernel Image Using LZ4

Written by Michael Larabel in Ubuntu on 6 June 2019 at 07:16 AM EDT. 26 Comments
UBUNTU
Ubuntu will begin compressing its kernel image / initramfs using the LZ4 compression scheme to improve the experience around their installer and for cloud/core/classic devices. There is some concern over the performance to which they may do additional tweaking.

For the past year Ubuntu developers have been talking of using LZ4 compression by default rather than Gzip for their kernel initramfs image. Using LZ4 yields a slightly larger file size but with quicker decompression/extraction speeds compared to Gzip. They seem to now be making that changeover for Ubuntu 19.10.

Ubuntu developer Dimitri John Ledkov who has long been involved in this effort commented this week on the Ubuntu mailing list with an update:
Zstd patches have not made it into the upstream kernel yet.

As used by mkinitramfs:
- lz4 is faster to compress than gzip
- lz4 is blazingly fast to decompress
- lzma is dog slow to compress and decompress, but is tiny
- lz4 size weight over gzip is marginal (14%) but imho worth the improved boot time & initrd creation time
- xz is potentially even slower and even smaller than lzma

In places where size is an absolute premium (tiny embedded iot devices) and performance is irrelevant, xz or lzma should be used.

In all other places, our performance profile is in favor of lz4.

Imho that includes the kernel image itself, thus we should consider switching:
- initramfs tools to default to lz4
- livecd-rootfs to default to lz4
- kernels to compress kernel image with lz4
- grub to include lz4 support

I shall proceed with changing the defaults on the above to improve our responsiveness experience on installer, cloud, core and classic devices. If our firstboot & subsequent boot speed degrades or disk space becomes a concern, we can look into tweaking these changes further.
Expect this for Ubuntu 19.10 to give it time for testing and tweaking ahead of Ubuntu 20.04 LTS.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week