diff options
-rw-r--r-- | drivers/lightnvm/pblk-init.c | 1 | ||||
-rw-r--r-- | drivers/lightnvm/pblk-read.c | 6 | ||||
-rw-r--r-- | drivers/lightnvm/pblk-sysfs.c | 3 | ||||
-rw-r--r-- | drivers/lightnvm/pblk.h | 1 |
4 files changed, 10 insertions, 1 deletions
diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c index aaefbccce30e..2d79336748ee 100644 --- a/drivers/lightnvm/pblk-init.c +++ b/drivers/lightnvm/pblk-init.c | |||
@@ -839,6 +839,7 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk, | |||
839 | atomic_long_set(&pblk->sync_writes, 0); | 839 | atomic_long_set(&pblk->sync_writes, 0); |
840 | atomic_long_set(&pblk->compl_writes, 0); | 840 | atomic_long_set(&pblk->compl_writes, 0); |
841 | atomic_long_set(&pblk->inflight_reads, 0); | 841 | atomic_long_set(&pblk->inflight_reads, 0); |
842 | atomic_long_set(&pblk->cache_reads, 0); | ||
842 | atomic_long_set(&pblk->sync_reads, 0); | 843 | atomic_long_set(&pblk->sync_reads, 0); |
843 | atomic_long_set(&pblk->recov_writes, 0); | 844 | atomic_long_set(&pblk->recov_writes, 0); |
844 | atomic_long_set(&pblk->recov_writes, 0); | 845 | atomic_long_set(&pblk->recov_writes, 0); |
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: | |||
76 | } | 76 | } |
77 | WARN_ON(test_and_set_bit(i, read_bitmap)); | 77 | WARN_ON(test_and_set_bit(i, read_bitmap)); |
78 | advanced_bio = 1; | 78 | advanced_bio = 1; |
79 | #ifdef CONFIG_NVM_DEBUG | ||
80 | atomic_long_inc(&pblk->cache_reads); | ||
81 | #endif | ||
79 | } else { | 82 | } else { |
80 | /* Read from media non-cached sectors */ | 83 | /* Read from media non-cached sectors */ |
81 | rqd->ppa_list[j++] = p; | 84 | rqd->ppa_list[j++] = p; |
@@ -280,6 +283,9 @@ retry: | |||
280 | goto retry; | 283 | goto retry; |
281 | } | 284 | } |
282 | WARN_ON(test_and_set_bit(0, read_bitmap)); | 285 | WARN_ON(test_and_set_bit(0, read_bitmap)); |
286 | #ifdef CONFIG_NVM_DEBUG | ||
287 | atomic_long_inc(&pblk->cache_reads); | ||
288 | #endif | ||
283 | } else { | 289 | } else { |
284 | rqd->ppa_addr = ppa; | 290 | rqd->ppa_addr = ppa; |
285 | } | 291 | } |
diff --git a/drivers/lightnvm/pblk-sysfs.c b/drivers/lightnvm/pblk-sysfs.c index f0af1d1ceeff..3c1a586c09a2 100644 --- a/drivers/lightnvm/pblk-sysfs.c +++ b/drivers/lightnvm/pblk-sysfs.c | |||
@@ -294,7 +294,7 @@ static ssize_t pblk_sysfs_lines_info(struct pblk *pblk, char *page) | |||
294 | static ssize_t pblk_sysfs_stats_debug(struct pblk *pblk, char *page) | 294 | static ssize_t pblk_sysfs_stats_debug(struct pblk *pblk, char *page) |
295 | { | 295 | { |
296 | return snprintf(page, PAGE_SIZE, | 296 | return snprintf(page, PAGE_SIZE, |
297 | "%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\n", | 297 | "%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\t%lu\n", |
298 | atomic_long_read(&pblk->inflight_writes), | 298 | atomic_long_read(&pblk->inflight_writes), |
299 | atomic_long_read(&pblk->inflight_reads), | 299 | atomic_long_read(&pblk->inflight_reads), |
300 | atomic_long_read(&pblk->req_writes), | 300 | atomic_long_read(&pblk->req_writes), |
@@ -307,6 +307,7 @@ static ssize_t pblk_sysfs_stats_debug(struct pblk *pblk, char *page) | |||
307 | atomic_long_read(&pblk->recov_writes), | 307 | atomic_long_read(&pblk->recov_writes), |
308 | atomic_long_read(&pblk->recov_gc_writes), | 308 | atomic_long_read(&pblk->recov_gc_writes), |
309 | atomic_long_read(&pblk->recov_gc_reads), | 309 | atomic_long_read(&pblk->recov_gc_reads), |
310 | atomic_long_read(&pblk->cache_reads), | ||
310 | atomic_long_read(&pblk->sync_reads)); | 311 | atomic_long_read(&pblk->sync_reads)); |
311 | } | 312 | } |
312 | #endif | 313 | #endif |
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h index 95b665f23925..77ee42a3f514 100644 --- a/drivers/lightnvm/pblk.h +++ b/drivers/lightnvm/pblk.h | |||
@@ -513,6 +513,7 @@ struct pblk { | |||
513 | atomic_long_t sync_writes; /* Sectors synced to media */ | 513 | atomic_long_t sync_writes; /* Sectors synced to media */ |
514 | atomic_long_t compl_writes; /* Sectors completed in write bio */ | 514 | atomic_long_t compl_writes; /* Sectors completed in write bio */ |
515 | atomic_long_t inflight_reads; /* Inflight sector read requests */ | 515 | atomic_long_t inflight_reads; /* Inflight sector read requests */ |
516 | atomic_long_t cache_reads; /* Read requests that hit the cache */ | ||
516 | atomic_long_t sync_reads; /* Completed sector read requests */ | 517 | atomic_long_t sync_reads; /* Completed sector read requests */ |
517 | atomic_long_t recov_writes; /* Sectors submitted from recovery */ | 518 | atomic_long_t recov_writes; /* Sectors submitted from recovery */ |
518 | atomic_long_t recov_gc_writes; /* Sectors submitted from write GC */ | 519 | atomic_long_t recov_gc_writes; /* Sectors submitted from write GC */ |