summaryrefslogtreecommitdiff
path: root/drivers/block/zram/zram_drv.h
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2018-12-28 00:36:51 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-28 12:11:49 -0800
commit23eddf39b2c28c05cb8f8203d38e61807d701b38 (patch)
tree30ec9421877d6171486386bb32122e7a077480bb /drivers/block/zram/zram_drv.h
parenta939888ec38bf1f33e4a903056677e92a4844244 (diff)
zram: add bd_stat statistics
bd_stat represents things that happened in the backing device. Currently it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. [minchan@kernel.org: v4] Link: http://lkml.kernel.org/r/20181203024045.153534-7-minchan@kernel.org Link: http://lkml.kernel.org/r/20181127055429.251614-7-minchan@kernel.org Signed-off-by: Minchan Kim <minchan@kernel.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Joey Pabalinas <joeypabalinas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block/zram/zram_drv.h')
-rw-r--r--drivers/block/zram/zram_drv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/block/zram/zram_drv.h b/drivers/block/zram/zram_drv.h
index 1ad74f030b6d..bc477803530d 100644
--- a/drivers/block/zram/zram_drv.h
+++ b/drivers/block/zram/zram_drv.h
@@ -82,6 +82,11 @@ struct zram_stats {
atomic_long_t max_used_pages; /* no. of maximum pages stored */
atomic64_t writestall; /* no. of write slow paths */
atomic64_t miss_free; /* no. of missed free */
+#ifdef CONFIG_ZRAM_WRITEBACK
+ atomic64_t bd_count; /* no. of pages in backing device */
+ atomic64_t bd_reads; /* no. of reads from backing device */
+ atomic64_t bd_writes; /* no. of writes from backing device */
+#endif
};
struct zram {