Btrfs Ready For Linux 5.6 With Async Discard For Better Efficiency + Performance
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:
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.
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.
3 Comments