Commit 364ad5ae authored by Alexey Marchuk's avatar Alexey Marchuk Committed by Tomasz Zawadzki
Browse files

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: default avatarAlexey Marchuk <alexeymar@mellanox.com>
Change-Id: I3ce4716ed6ac1369b6f72b03cbcfd7d407f7de55
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7282


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatar <dongx.yi@intel.com>
parent 0c78378a
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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;
}