]> git.baikalelectronics.ru Git - kernel.git/commit
bcache: simplify the calculation of the total amount of flash dirty data
authorTang Junhui <tang.junhui@zte.com.cn>
Thu, 26 Jul 2018 04:17:33 +0000 (12:17 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 27 Jul 2018 15:15:46 +0000 (09:15 -0600)
commitd5bebe446ed4276120d9d56321d981daf2905283
treec83e8de58955e7f93ebc766aac923e6f746a8d0b
parentd993fb67a71660b744a3def1a70007dedeba4c4b
bcache: simplify the calculation of the total amount of flash dirty data

Currently we calculate the total amount of flash only devices dirty data
by adding the dirty data of each flash only device under registering
locker. It is very inefficient.

In this patch, we add a member flash_dev_dirty_sectors in struct cache_set
to record the total amount of flash only devices dirty data in real time,
so we didn't need to calculate the total amount of dirty data any more.

Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/bcache.h
drivers/md/bcache/super.c
drivers/md/bcache/writeback.c
drivers/md/bcache/writeback.h