perf: Cleanup ns_worker_ctx after draining IO

Function cleanup_ns_worker_ctx is only called for
ns_ctx which have outstanding IO, so when draining
phase is started and some context doesn't have
outstanding IO, it won't be cleaned properly.

To fix this problem, call cleanup_ns_worker_ctx for
every context when drining is finished.

Fixes issue #1880

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I3ce4716ed6ac1369b6f72b03cbcfd7d407f7de55
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7282
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: <dongx.yi@intel.com>
This commit is contained in:
Alexey Marchuk 2021-04-08 10:37:29 +03:00 committed by Tomasz Zawadzki
parent 0c78378a63
commit 364ad5aedc

View File

@ -1669,15 +1669,17 @@ work_fn(void *arg)
if (ns_ctx->current_queue_depth > 0) {
ns_ctx->entry->fn_table->check_io(ns_ctx);
if (ns_ctx->current_queue_depth == 0) {
cleanup_ns_worker_ctx(ns_ctx);
} else {
if (ns_ctx->current_queue_depth > 0) {
unfinished_ns_ctx++;
}
}
}
} while (unfinished_ns_ctx > 0);
TAILQ_FOREACH(ns_ctx, &worker->ns_ctx, link) {
cleanup_ns_worker_ctx(ns_ctx);
}
return 0;
}