summaryrefslogtreecommitdiffstats
path: root/drivers/lightnvm/pblk-read.c
diff options
context:
space:
mode:
authorJavier González <jg@lightnvm.io>2017-06-26 11:57:13 +0200
committerJens Axboe <axboe@kernel.dk>2017-06-26 16:24:53 -0600
commitdb7ada33cdcae7fef0a088141b1e4ab8c25fd395 (patch)
tree10e098319a92916b999c5b52e532306ec65e9f57 /drivers/lightnvm/pblk-read.c
parentcaa69fa560025d12c276abd62d58a87b94324708 (diff)
downloadlinux-db7ada33cdcae7fef0a088141b1e4ab8c25fd395.tar.bz2
lightnvm: pblk: add debug stat for read cache hits
Add a new debug counter to measure cache hits on the read path Signed-off-by: Javier González <javier@cnexlabs.com> Signed-off-by: Matias Bjørling <matias@cnexlabs.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/lightnvm/pblk-read.c')
-rw-r--r--drivers/lightnvm/pblk-read.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c
index 74d3fc53022e..f12f40a41558 100644
--- a/drivers/lightnvm/pblk-read.c
+++ b/drivers/lightnvm/pblk-read.c
@@ -76,6 +76,9 @@ retry:
}
WARN_ON(test_and_set_bit(i, read_bitmap));
advanced_bio = 1;
+#ifdef CONFIG_NVM_DEBUG
+ atomic_long_inc(&pblk->cache_reads);
+#endif
} else {
/* Read from media non-cached sectors */
rqd->ppa_list[j++] = p;
@@ -280,6 +283,9 @@ retry:
goto retry;
}
WARN_ON(test_and_set_bit(0, read_bitmap));
+#ifdef CONFIG_NVM_DEBUG
+ atomic_long_inc(&pblk->cache_reads);
+#endif
} else {
rqd->ppa_addr = ppa;
}