bcache: rearrange writeback main thread ratelimit
authorMichael Lyle <mlyle@lyle.org>
Fri, 13 Oct 2017 23:35:39 +0000 (16:35 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Oct 2017 15:07:26 +0000 (09:07 -0600)
commita8500fc816b19795756d27c762daa5e19f5e1b6f
tree38d73cfab43258b7d24a1f9ea7502dc87e93c425
parente41166c5c44e30dbd620f7c77a27efe5d5cc551a
bcache: rearrange writeback main thread ratelimit

The time spent searching for things to write back "counts" for the
actual rate achieved, so don't flush the accumulated rate with each
chunk.

This will maintain better fidelity to user-commanded rates, but it
may slightly increase the burstiness of writeback.  The writeback
lock needs improvement to help mitigate this.

Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/writeback.c