lib/ftl: Update FTL IO activity statistics

Bumping the IO activity statistics during relocation, compaction, L2P
cache processing and user IO handling. This makes sure poller busy
counter is more accurate.

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Change-Id: Iabf8ec7ca41c01d7a00d3a70825b8d5283ab2bf1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15257
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
Kozlowski Mateusz 2022-10-21 08:40:06 +02:00 committed by Tomasz Zawadzki
parent a7f4a2db7f
commit 646b851e75
5 changed files with 18 additions and 0 deletions

View File

@ -644,6 +644,7 @@ ftl_process_io_queue(struct spdk_ftl_dev *dev)
TAILQ_REMOVE(&dev->rd_sq, io, queue_entry);
assert(io->type == FTL_IO_READ);
ftl_io_pin(io);
ftl_add_io_activity(dev);
}
while (!TAILQ_EMPTY(&dev->wr_sq) && !ftl_nv_cache_throttle(dev)) {
@ -654,6 +655,7 @@ ftl_process_io_queue(struct spdk_ftl_dev *dev)
TAILQ_INSERT_HEAD(&dev->wr_sq, io, queue_entry);
break;
}
ftl_add_io_activity(dev);
}
if (!TAILQ_EMPTY(&dev->unmap_sq) && dev->unmap_qd == 0) {
@ -669,6 +671,8 @@ ftl_process_io_queue(struct spdk_ftl_dev *dev)
*/
if (!ftl_process_unmap(io)) {
TAILQ_INSERT_HEAD(&dev->unmap_sq, io, queue_entry);
} else {
ftl_add_io_activity(dev);
}
}

View File

@ -233,6 +233,12 @@ ftl_get_core_thread(const struct spdk_ftl_dev *dev)
return dev->core_thread;
}
static inline void
ftl_add_io_activity(struct spdk_ftl_dev *dev)
{
dev->stats.io_activity_total++;
}
static inline uint64_t
ftl_get_num_bands(const struct spdk_ftl_dev *dev)
{

View File

@ -1332,6 +1332,8 @@ ftl_l2p_cache_process_page_sets(struct spdk_ftl_dev *dev, struct ftl_l2p_cache *
return -EBUSY;
}
ftl_add_io_activity(dev);
TAILQ_REMOVE(&cache->deferred_page_set_list, page_set, list_entry);
page_set->deferred = 0;
page_set->locked = 1;
@ -1477,6 +1479,8 @@ ftl_l2p_cache_process_eviction(struct spdk_ftl_dev *dev, struct ftl_l2p_cache *c
return;
}
ftl_add_io_activity(dev);
page = eviction_get_page(dev, cache);
if (spdk_unlikely(!page)) {
return;

View File

@ -1329,6 +1329,7 @@ ftl_nv_cache_process(struct spdk_ftl_dev *dev)
nv_cache->chunk_free_count--;
chunk->md->seq_id = ftl_get_next_seq_id(dev);
ftl_chunk_open(chunk);
ftl_add_io_activity(dev);
}
if (is_compaction_required(nv_cache) && !TAILQ_EMPTY(&nv_cache->compactor_list)) {
@ -1338,6 +1339,7 @@ ftl_nv_cache_process(struct spdk_ftl_dev *dev)
TAILQ_REMOVE(&nv_cache->compactor_list, comp, entry);
compaction_process_start(comp);
ftl_add_io_activity(dev);
}
ftl_chunk_persist_free_state(nv_cache);

View File

@ -568,6 +568,7 @@ move_run(struct ftl_reloc *reloc, struct ftl_reloc_move *mv)
case FTL_RELOC_STATE_PIN:
move_pin(mv);
ftl_add_io_activity(reloc->dev);
break;
case FTL_RELOC_STATE_WRITE:
@ -577,6 +578,7 @@ move_run(struct ftl_reloc *reloc, struct ftl_reloc_move *mv)
break;
}
ftl_add_io_activity(reloc->dev);
move_write(reloc, mv);
break;