linux/drivers/md/bcache
Tang Junhui 175206cf9a bcache: initialize dirty stripes in flash_dev_run()
bcache uses a Proportion-Differentiation Controller algorithm to control
writeback rate to cached devices. In the PD controller algorithm, dirty
stripes of thin flash device should not be counted in, because flash only
volumes never write back dirty data.

Currently dirty stripe counter for thin flash device is not initialized
when the thin flash device starts. Which means the following calculation
in PD controller will reference an undefined dirty stripes number, and
all cached devices attached to the same cache set where the thin flash
device lies on may have an inaccurate writeback rate.

This patch calles bch_sectors_dirty_init() in flash_dev_run(), to
correctly initialize dirty stripe counter when the thin flash device
starts to run. This patch also does following parameter data type change,
 -void bch_sectors_dirty_init(struct cached_dev *dc);
 +void bch_sectors_dirty_init(struct bcache_device *);
to call this function conveniently in flash_dev_run().

(Commit log is composed by Coly Li)

Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>
Reviewed-by: Coly Li <colyli@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2017-09-07 13:32:29 -06:00
..
alloc.c bcache: increase the number of open buckets 2017-09-06 08:17:33 -06:00
bcache.h bcache: fix for gc and write-back race 2017-09-06 08:17:33 -06:00
bset.c
bset.h
btree.c
btree.h
closure.c bcache: Don't reinvent the wheel but use existing llist API 2017-09-06 08:17:33 -06:00
closure.h bcache: Update continue_at() documentation 2017-09-06 08:17:33 -06:00
debug.c block: replace bi_bdev with a gendisk pointer and partitions index 2017-08-23 12:49:55 -06:00
debug.h
extents.c
extents.h
io.c block: replace bi_bdev with a gendisk pointer and partitions index 2017-08-23 12:49:55 -06:00
journal.c block: replace bi_bdev with a gendisk pointer and partitions index 2017-08-23 12:49:55 -06:00
journal.h
Kconfig
Makefile
movinggc.c
request.c bcache: do not subtract sectors_to_gc for bypassed IO 2017-09-06 08:17:33 -06:00
request.h
stats.c
stats.h
super.c bcache: initialize dirty stripes in flash_dev_run() 2017-09-07 13:32:29 -06:00
sysfs.c bcache: Correct return value for sysfs attach errors 2017-09-06 08:17:33 -06:00
sysfs.h
trace.c
util.c bcache: fix bch_hprint crash and improve output 2017-09-06 08:17:33 -06:00
util.h
writeback.c bcache: initialize dirty stripes in flash_dev_run() 2017-09-07 13:32:29 -06:00
writeback.h bcache: initialize dirty stripes in flash_dev_run() 2017-09-07 13:32:29 -06:00