Please sign in to comment.
block_cache: Compute the timeout dynamically based on write speeds.
We now record how long it takes to write a block (on average), and then utilize this information to reduce the timeout write thread's timeout (to 2 * block_count * average_block_time, so we don't completely congest the drive.) Remove the "TODO" about the I/O scheduler; this new logic will be just fine even under an I/O scheduler. Note that this change goes both ways: while faster writes mean more writes and quicker, slower writes will increase the timeout before we do another one also. This then also guards against queueing another write while one is already in progress, which was not handled before. Tested in KVM. Even on a SATA-backed spinning HDD, this reduces the timeout to around *200ms* on average (!!), so a 10x improvement. On a ramdisk, it reduces the timeout to *10-30ms* (!!!) on average, so a 100-200x improvement, so this change will benefit everyone but SSDs especially. Since BFS inode and journal writes always go through the block_cache, this very dramatically improves inode-related write performance. The "stop and start" stutters when emptying or moving items to Trash seem totally gone, among a lot of other things. Change-Id: I41f46a6432ce1f50f896a853abdfe22dde0ba327
- Loading branch information...
Showing with 50 additions and 8 deletions.