New Zstd for Linux 5.16 is ready, bringing up to 35% performance improvement

Recently, the new Zstd prepared for the Linux 5.16 kernel has been submitted to the linux-next merger for more extensive testing in the next few weeks. If nothing happens, we will see the updated code of Zstd in the Linux 5.16 merge window next month.

Nick Terrell, a Zstd maintainer from Facebook, recently started retrying to update the Zstd implementation of the Linux kernel. Today, he released the latest Zstd kernel patch (based on Zstd 1.4.10). Compared with the current mainline, this version provides an updated code that will provide better performance and fix a large number of bugs in the old version of Zstd.

Linux kernel removing support x32
The current Zstd code in the Linux kernel has a history of four years (Zstd 1.3.1), so the Zstd code in the kernel is seriously outdated. Over the past many years, Zstd has had many fixes and performance improvements upstream.
Once the kernel introduces this Zstd update, the compression of Btrfs Zstd can be 5% faster, Btrfs Zstd decompression can be about 15% faster, SquashFS Zstd decompression can also be about 15% faster, F2FS Zstd decompression can be about 20% faster when reading, zRAM decompression can be about 30% faster, kernel Zstd image decompression can be about 35% faster, and initramfs Zstd decompression and build can be about 5% faster.

As can be seen from the above data, these patches provide a great performance improvement for the Zstd implementation in the Linux kernel, especially in terms of decompression. In addition to the performance improvement, the new code introduces a new encapsulation API in Zstd, which can make the code update smoother and easier. Therefore, with the subsequent release of Zstd 1.5.1, the Linux kernel code will be easier to achieve a state based on Zstd 1.5.1.