• Michael Lyle's avatar
    bcache: fix writeback target calc on large devices · 616486ab
    Michael Lyle authored
    Bcache needs to scale the dirty data in the cache over the multiple
    backing disks in order to calculate writeback rates for each.
    The previous code did this by multiplying the target number of dirty
    sectors by the backing device size, and expected it to fit into a
    uint64_t; this blows up on relatively small backing devices.
    
    The new approach figures out the bdev's share in 16384ths of the overall
    cached data.  This is chosen to cope well when bdevs drastically vary in
    size and to ensure that bcache can cross the petabyte boundary for each
    backing device.
    
    This has been improved based on Tang Junhui's feedback to ensure that
    every device gets a share of dirty data, no matter how small it is
    compared to the total backing pool.
    
    The existing mechanism is very limited; this is purely a bug fix to
    remove limits on volume size.  However, there still needs to be change
    to make this "fair" over many volumes where some are idle.
    Reported-by: default avatarJack Douglas <jack@douglastechnology.co.uk>
    Signed-off-by: default avatarMichael Lyle <mlyle@lyle.org>
    Reviewed-by: default avatarTang Junhui <tang.junhui@zte.com.cn>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    616486ab
writeback.c 17 KB