<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc" -->

---
title: A Nice Improvement Coming For Faster Btrfs Zstd...
description: A performance improvement is queued in the Btrfs file-system&#x27;s &#x27;for-next&#x27; Git branch ahead of the Linux 7.4 cycle, addressing double-writing of bytes during...
canonical: https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: A Nice Improvement Coming For Faster Btrfs Zstd Decompression | daily.dev
og:description: A performance improvement is queued in the Btrfs file-system&#x27;s &#x27;for-next&#x27; Git branch ahead of the Linux 7.4 cycle, addressing double-writing of bytes during...
og:url: https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc
og:image: https://api.daily.dev/og/posts/1BZlpVKrC.png
og:image:alt: A Nice Improvement Coming For Faster Btrfs Zstd Decompression
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A Nice Improvement Coming For Faster Btrfs Zstd Decompression

**[Phoronix](https://daily.dev/sources/phoronix)** · 2 min read · 0 upvotes · 0 comments

## Summary

A performance improvement is queued in the Btrfs file-system's 'for-next' Git branch ahead of the Linux 7.4 cycle, addressing double-writing of bytes during Zstd decompression. Developer Usama Arif found that btrfs_decompress_buf2page() copied data that zstd_map_dest() could instead write directly into the page cache. Benchmarks show a 7.8% reduction in sequential read time with 4K sectors, 3.6% with 16K sectors, 6.8% with 64K sectors, and around 3% improvement for random 4K reads.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.phoronix.com/news/Btrfs-Zstd-Faster-Decompress>

## Questions this post answers

### What performance improvement does the new Btrfs zstd decompression patch bring in Linux 7.4?

The patch queued for Linux 7.4 eliminates a redundant byte copy in Btrfs zstd decompression by having zstd write directly into page cache via zstd_map_dest() instead of using an intermediate scratch buffer. Usama Arif measured a 7.8% reduction in sequential read time at 4K sector size, 3.6% at 16K, 6.8% at 64K, and about 3% improvement for random 4K reads.

_Track kernel filesystem performance changes like this Btrfs zstd fix as they land, on daily.dev._

### Why was Btrfs zstd decompression writing every byte twice before this fix?

zstd_decompress_bio() allocated a sectorsize-sized scratch buffer for zstd output, and btrfs_decompress_buf2page() then copied the overlapping portion into the destination page cache folios, meaning every delivered byte was written once to the scratch buffer and again to its final destination. The fix has zstd write directly into the page cache for most cases, keeping the scratch buffer only for prefixes and cache gaps.

_Follow filesystem-level optimizations like this one on daily.dev to stay ahead of kernel performance changes._

## Similar posts on daily.dev

- [Patches Provide For Much Faster In-Kernel Zstd Due To Embarrassingly Bad Inefficiency](https://daily.dev/posts/patches-provide-for-much-faster-in-kernel-zstd-due-to-embarrassingly-bad-inefficiency-zshp9rw2o) · Phoronix · 1 upvotes · 0 comments
- [Btrfs Ready With More Performance Improvements For Linux 7.3: Some ~3x To ~5x Wins](https://daily.dev/posts/btrfs-ready-with-more-performance-improvements-for-linux-7-3-some-3x-to-5x-wins-b4x0ludw1) · Phoronix · 1 upvotes · 0 comments
- [Benchmarking Some Incredible Performance Gains With Btrfs On Linux 7.3](https://daily.dev/posts/benchmarking-some-incredible-performance-gains-with-btrfs-on-linux-7-3-x5wupj1ld) · Phoronix · 0 upvotes · 0 comments
- [Btrfs Change Coming For Linux 7.2 Yields Very Healthy Performance Gain](https://daily.dev/posts/btrfs-change-coming-for-linux-7-2-yields-very-healthy-performance-gain-qsfimmuky) · Phoronix · 10 upvotes · 0 comments
- [Btrfs Brings Performance Improvements, Shutdown ioctl Stable With Linux 7.1](https://daily.dev/posts/btrfs-brings-performance-improvements-shutdown-ioctl-stable-with-linux-7-1-wjasfn6w6) · Phoronix · 0 upvotes · 0 comments

---

Tags: [#linux](https://daily.dev/tags/linux), [#performance](https://daily.dev/tags/performance)

[View this post on daily.dev](https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"A Nice Improvement Coming For Faster Btrfs Zstd Decompression","url":"https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc"},"datePublished":"2026-09-09T12:59:22.142Z","dateModified":"2026-09-09T12:59:50.779Z","description":"A performance improvement is queued in the Btrfs file-system's 'for-next' Git branch ahead of the Linux 7.4 cycle, addressing double-writing of bytes during...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8ab14bd4dcc524b38f9fc8d861280671?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8ab14bd4dcc524b38f9fc8d861280671?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Phoronix","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Phoronix","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/6a26ba379dd64932830aa0c9803dd7ee","url":"https://daily.dev/sources/phoronix"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"linux,performance","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Phoronix","item":"https://daily.dev/sources/phoronix"},{"@type":"ListItem","position":3,"name":"A Nice Improvement Coming For Faster Btrfs Zstd Decompression"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/a-nice-improvement-coming-for-faster-btrfs-zstd-decompression-1bzlpvkrc#faq","mainEntity":[{"@type":"Question","name":"What performance improvement does the new Btrfs zstd decompression patch bring in Linux 7.4?","acceptedAnswer":{"@type":"Answer","text":"The patch queued for Linux 7.4 eliminates a redundant byte copy in Btrfs zstd decompression by having zstd write directly into page cache via zstd_map_dest() instead of using an intermediate scratch buffer. Usama Arif measured a 7.8% reduction in sequential read time at 4K sector size, 3.6% at 16K, 6.8% at 64K, and about 3% improvement for random 4K reads. Track kernel filesystem performance changes like this Btrfs zstd fix as they land, on daily.dev."}},{"@type":"Question","name":"Why was Btrfs zstd decompression writing every byte twice before this fix?","acceptedAnswer":{"@type":"Answer","text":"zstd_decompress_bio() allocated a sectorsize-sized scratch buffer for zstd output, and btrfs_decompress_buf2page() then copied the overlapping portion into the destination page cache folios, meaning every delivered byte was written once to the scratch buffer and again to its final destination. The fix has zstd write directly into the page cache for most cases, keeping the scratch buffer only for prefixes and cache gaps. Follow filesystem-level optimizations like this one on daily.dev to stay ahead of kernel performance changes."}}]}
```

