VOOZH about

URL: https://www.phoronix.com/news/Btrfs-No-Serialize-Direct-IO

⇱ Btrfs Change Coming For Linux 7.2 Yields Very Healthy Performance Gain - Phoronix


👁 Phoronix

Btrfs Change Coming For Linux 7.2 Yields Very Healthy Performance Gain

Written by Michael Larabel in Linux Storage on 29 May 2026 at 07:17 AM EDT. 38 Comments
A change coming on the way for the upcoming Linux 7.2 kernel cycle is yielding a significant improvement to the direct I/O write performance. While a big gain, technically it's a regression fix after a change mistakenly dropped the behavior several years ago.

The change on its way to Linux 7.2 for Btrfs is to not force Direct I/O (DIO) writes to be serialized. Mark Harmstone with Meta discovered that Btrfs was mistakenly serializing DIO writes since 2023 when converting the file-system over to the new mount API for the Linux kernel. Harmstone explained with :
"Before btrfs switched to the new mount API in 2023, we were setting SB_NOSEC in btrfs_mount_root(). This flag tells the VFS that the filesystem may have files which don't have security xattrs, enabling it to do some optimizations.

Unfortunately this was missed in the transition, meaning that IS_NOSEC will always return false for a btrfs inode. This means that btrfs_direct_write() calls will always get the inode lock exclusively, meaning that DIO writes to the same file will be serialized.

On my machine, this one-line change results in a ~59% improvement in DIO throughput."

A very nice win with nearly 60% throughput improvement from 826 MB/s to 1311 MB/s.

Intel's Kernel Test Robot is also reporting around a 12% improvement for Btrfs with this change in their own test and hardware.

👁 NVMe SSD


With the patch now in the "-next" code, look for this Btrfs change to land with the Linux 7.2 merge window happening in June.

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.