From b6e9e1abb4695b82b1da10ec6e10fcaad8af3fed Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Wed, 7 Sep 2022 17:29:55 +0200 Subject: [PATCH] example/perf: comment the ns to worker association This documents the logic below and motivation behind (70db0e1)nvme/perf: Add support for multiple cores per device. Change-Id: I949b794355f871c0f995b946622dbe77295d922b Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14413 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Jacek Kalwas Reviewed-by: Aleksey Marchuk --- examples/nvme/perf/perf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 7d422a72c..c3e6aa697 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -2837,6 +2837,11 @@ associate_workers_with_ns(void) struct ns_worker_ctx *ns_ctx; int i, count; + /* Each core contains single worker, and namespaces are associated as follows: + * 1) equal workers and namespaces - each worker associated with single namespace + * 2) more workers than namespaces - each namespace is associated with one or more workers + * 3) more namespaces than workers - each worker is associated with one or more namespaces + */ count = g_num_namespaces > g_num_workers ? g_num_namespaces : g_num_workers; for (i = 0; i < count; i++) {