diff options
author | Tang Junhui <tang.junhui@zte.com.cn> | 2018-02-07 11:41:39 -0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-02-07 12:50:01 -0700 |
commit | a728eacbbdd229d1d903e46261c57d5206f87a4a (patch) | |
tree | 16b0773daa7c4b7d222b221cf75470ad34c39dc8 /drivers/md/bcache/bcache.h | |
parent | 30abb3a67f4b2aa160feeb3c0b771f730cbcca67 (diff) | |
download | linux-a728eacbbdd229d1d903e46261c57d5206f87a4a.tar.gz linux-a728eacbbdd229d1d903e46261c57d5206f87a4a.tar.bz2 linux-a728eacbbdd229d1d903e46261c57d5206f87a4a.zip |
bcache: add journal statistic
Sometimes, Journal takes up a lot of CPU, we need statistics
to know what's the journal is doing. So this patch provide
some journal statistics:
1) reclaim: how many times the journal try to reclaim resource,
usually the journal bucket or/and the pin are exhausted.
2) flush_write: how many times the journal try to flush btree node
to cache device, usually the journal bucket are exhausted.
3) retry_flush_write: how many times the journal retry to flush
the next btree node, usually the previous tree node have been
flushed by other thread.
we show these statistic by sysfs interface. Through these statistics
We can totally see the status of journal module when the CPU is too
high.
Signed-off-by: Tang Junhui <tang.junhui@zte.com.cn>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/bcache.h')
-rw-r--r-- | drivers/md/bcache/bcache.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index 5e2d4e80198e..b98d7705acb6 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h @@ -658,6 +658,10 @@ struct cache_set { atomic_long_t writeback_keys_done; atomic_long_t writeback_keys_failed; + atomic_long_t reclaim; + atomic_long_t flush_write; + atomic_long_t retry_flush_write; + enum { ON_ERROR_UNREGISTER, ON_ERROR_PANIC, |