• Michael Lyle's avatar
    bcache: writeback: properly order backing device IO · 6e6ccc67
    Michael Lyle authored
    Writeback keys are presently iterated and dispatched for writeback in
    order of the logical block address on the backing device.  Multiple may
    be, in parallel, read from the cache device and then written back
    (especially when there are contiguous I/O).
    
    However-- there was no guarantee with the existing code that the writes
    would be issued in LBA order, as the reads from the cache device are
    often re-ordered.  In turn, when writing back quickly, the backing disk
    often has to seek backwards-- this slows writeback and increases
    utilization.
    
    This patch introduces an ordering mechanism that guarantees that the
    original order of issue is maintained for the write portion of the I/O.
    Performance for writeback is significantly improved when there are
    multiple contiguous keys or high writeback rates.
    Signed-off-by: default avatarMichael Lyle <mlyle@lyle.org>
    Reviewed-by: default avatarTang Junhui <tang.junhui@zte.com.cn>
    Tested-by: default avatarTang Junhui <tang.junhui@zte.com.cn>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    6e6ccc67
writeback.c 15.6 KB