summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/bcache.h
diff options
context:
space:
mode:
authorTang Junhui <tang.junhui@zte.com.cn>2018-07-26 06:17:33 +0200
committerJens Axboe <axboe@kernel.dk>2018-07-27 17:15:46 +0200
commit99a27d59bd7b2ce1a82a4e826e8e7881f4d4954d (patch)
treec83e8de58955e7f93ebc766aac923e6f746a8d0b /drivers/md/bcache/bcache.h
parentreadahead: stricter check for bdi io_pages (diff)
downloadlinux-99a27d59bd7b2ce1a82a4e826e8e7881f4d4954d.tar.xz
linux-99a27d59bd7b2ce1a82a4e826e8e7881f4d4954d.zip
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>
Diffstat (limited to 'drivers/md/bcache/bcache.h')
-rw-r--r--drivers/md/bcache/bcache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index d6bf294f3907..3226d38bf859 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -525,6 +525,7 @@ struct cache_set {
unsigned devices_max_used;
struct list_head cached_devs;
uint64_t cached_dev_sectors;
+ atomic_long_t flash_dev_dirty_sectors;
struct closure caching;
struct closure sb_write;