Btrfs Receives A Very Important Last Minute Fix For Linux 6.3

Written by Michael Larabel in Linux Storage on 21 April 2023 at 01:00 PM EDT. 42 Comments
LINUX STORAGE
Ahead of the Linux 6.3 kernel being potentially released as stable on Sunday, two last minute patches for the Btrfs file-system driver were submitted today to address a pressing problem since Linux 6.2.

Btrfs for Linux 6.3 is seeing last minute work to fix problems with async discard, which has been enabled by default since Linux 6.2. The default async discard behavior had a low IOPS limit and processing a large batch of discards would take a long time and waste power / disk activity.

Btrfs


Boris Burkov sent out the Btrfs patches earlier this month and explained:
"Since discard=async became the implicit default in btrfs in the 6.2 kernel, there have been numerous complaints about discard being too spread out on workstation systems. This results in situations like a users drive not being idle for an unexpectedly long period of time.

This is caused by a relatively low default iops limit of 10, so this series raises the default limit to 1000 (1ms delay) and modifies a weird fallback behavior for limit=0 to be interpreted as unlimited.
...
Previously, the default was a relatively conservative 10. This results in a 100ms delay, so with ~300 discards in a commit, it takes the full 30s till the next commit to finish the discards. On a workstation, this results in the disk never going idle, wasting power/battery, etc.

Set the default to 1000, which results in using the smallest possible delay, currently, which is 1ms. This has shown to not pathologically keep the disk busy by the original reporter."

The Btrfs change should land shortly in Linux 6.3 Git and presumably picked up by Linux 6.2 as a stable fix too.
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