An asynchronous implementation of DISCARD is introduced for Btrfs

For the btrfs file system it has been presented an asynchronous implementation of the DISCARD operation (marking released blocks that no longer need to be physically stored), developed by engineers at Facebook.

The essence of the problem: in the initial implementation, DISCARD executes synchronously with other operations, which in some cases leads to performance issues because it has to wait for the drives to finish the corresponding commands, requiring additional time. This can become a problem if the DISCARD implementation by the drive operates slowly.

With the asynchronous implementation, waiting for the completion of DISCARD by the drive during normal FS operations is unnecessary, which resolves the issue by turning this operation into a background task. The introduced implementation also performs some optimizations. For example, it waits for a certain time based on the assumption that the block may soon be used, making the DISCARD procedure unnecessary, and it also attempts to consolidate regions before actually performing DISCARD to reduce the overall number of operations.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster