Btrfs Ready For Linux 5.6 With Async Discard For Better Efficiency + Performance

Written by Michael Larabel in Linux Storage on 27 January 2020 at 11:44 AM EST. 3 Comments
Btrfs in the now-stable Linux 5.5 kernel is exciting for its new RAID1C3/RAID1C4 capability allowing three/four copies of data rather than just two while looking ahead to Linux 5.6 is further feature work on this Linux file-system.

The big Btrfs item on the table with Linux 5.6 is async discard support developed by Facebook engineers and so solid-state drive TRIM/DISCARD support isn't done synchronously. This led to an efficiency improvement and lower read latencies when deploying the feature on Facebook servers.

The PR explains the async discard details:
* "mount -o discard=async" to enable it
* freed extents are not discarded immediatelly, but grouped together and trimmed later, with IO rate limiting
* the "sync" mode submits short extents that could have been ignored completely by the device, for SATA prior to 3.1 the requests are unqueued and have a big impact on performance
* the actual discard IO requests have been moved out of transaction commit to a worker thread, improving commit latency
* IO rate and request size can be tuned by sysfs files, for now enabled only with CONFIG_BTRFS_DEBUG as we might need to add/delete the files and don't have a stable-ish ABI for general use, defaults are conservative

The Btrfs for Linux 5.6 pull also now exports more device state information via sysfs, a variety of bug fixes, dropping of snapshot aware code that has been disabled for years due to performance issues, and other code improvements.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of 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 automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week