In addition to the still-pending kernel work for improving the in-kernel Zstd code, sepaarately the Btrfs file-system driver has an improvement on the way in its decompression code path for the Zstd transparent file-system compression. Queued into the Btrfs file-systems "for-next" Git branch ahead of the Linux 7.4 cycle kicking off in October is a nice Zstd decompression improvement. Linux developer Usama Arif discovered that in the Btrfs Zstd decompression path that every delivered byte is currently written twice: "zstd_decompress_bio() gives zstd a sectorsize-sized scratch buffer, and btrfs_decompress_buf2page() then copies the part overlapping the read bio into the destination folios. Every delivered byte is written twice. Instead, choose the output buffer per streaming call. zstd_map_dest() kmaps the current page-bounded segment of the read bio, so zstd writes into the page cache directly. The scratch buffer is kept only for output with no destination: the prefix before a read starting inside a compressed extent, which zstd cannot skip, and gaps left by folios already in the page cache." The end result is quite beneficial with Usama noting a 7.8% reduction in sequential read time with 4K sector size, 3.6% reduction with a 16K sector size, or 6.8% time reduction with a 64K sector size. For random 4K reads was around a 3% improvement when utilizing Btrfs with Zstd compression enabled. The patch is queued in the for-next branch so look for it with the Linux 7.4 kernel cycle. Hopefully the other Zstd kernel improvements will make it for Linux 7.4 as well.
A Nice Improvement Coming For Faster Btrfs Zstd Decompression
Full Article
Original Source
Read the full article at Phoronix →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.