nvmf: do not encode core number into thread name

The nvmf subsystem cannot control which core its
threads get scheduled on.  Even in the normal, default
case, the app thread has already been scheduled on the
first core, so the first nvmf thread will get
scheduled on the second core, etc.

So instead, always use a 0-based index for the names
of the nvmf threads.

Reported-by: Jacek Kalwas <jacek.kalwas@intel.com>
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8a0f161860b985f36920845de28b39dbae9fdca5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11351
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
This commit is contained in:
Jim Harris 2022-01-28 14:58:28 +00:00 committed by Tomasz Zawadzki
parent 236cc3a188
commit 120a6c1c2a

View File

@ -209,18 +209,18 @@ nvmf_tgt_create_poll_group(void *ctx)
static void
nvmf_tgt_create_poll_groups(void)
{
uint32_t i;
uint32_t cpu, count = 0;
char thread_name[32];
struct spdk_thread *thread;
g_tgt_init_thread = spdk_get_thread();
assert(g_tgt_init_thread != NULL);
SPDK_ENV_FOREACH_CORE(i) {
if (g_poll_groups_mask && !spdk_cpuset_get_cpu(g_poll_groups_mask, i)) {
SPDK_ENV_FOREACH_CORE(cpu) {
if (g_poll_groups_mask && !spdk_cpuset_get_cpu(g_poll_groups_mask, cpu)) {
continue;
}
snprintf(thread_name, sizeof(thread_name), "nvmf_tgt_poll_group_%u", i);
snprintf(thread_name, sizeof(thread_name), "nvmf_tgt_poll_group_%u", count++);
thread = spdk_thread_create(thread_name, g_poll_groups_mask);
assert(thread != NULL);