Revert "lib/event: do not spawn a thread for each reactor"
This reverts commit 72eed604b4
.
spdk_vhost_init() relies on having a thread on each reactor.
Without the revert, every vhost controller is created on the same
core and even passing --cpumask when creating does not affect it.
Proper fix would be to change spdk_vhost_init(),
but would require additional testing. For now revert the patch
that spawned always idle threads.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I0dbd6c9fe1d9d23ada260da8fc7b48086223c632
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6186
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
This commit is contained in:
parent
c15af452f6
commit
7cc83b6258
@ -1010,8 +1010,10 @@ void
|
|||||||
spdk_reactors_start(void)
|
spdk_reactors_start(void)
|
||||||
{
|
{
|
||||||
struct spdk_reactor *reactor;
|
struct spdk_reactor *reactor;
|
||||||
|
struct spdk_cpuset tmp_cpumask = {};
|
||||||
uint32_t i, current_core;
|
uint32_t i, current_core;
|
||||||
int rc;
|
int rc;
|
||||||
|
char thread_name[32];
|
||||||
|
|
||||||
g_rusage_period = (CONTEXT_SWITCH_MONITOR_PERIOD * spdk_get_ticks_hz()) / SPDK_SEC_TO_USEC;
|
g_rusage_period = (CONTEXT_SWITCH_MONITOR_PERIOD * spdk_get_ticks_hz()) / SPDK_SEC_TO_USEC;
|
||||||
g_reactor_state = SPDK_REACTOR_STATE_RUNNING;
|
g_reactor_state = SPDK_REACTOR_STATE_RUNNING;
|
||||||
@ -1030,6 +1032,14 @@ spdk_reactors_start(void)
|
|||||||
assert(false);
|
assert(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* For now, for each reactor spawn one thread. */
|
||||||
|
snprintf(thread_name, sizeof(thread_name), "reactor_%u", reactor->lcore);
|
||||||
|
|
||||||
|
spdk_cpuset_zero(&tmp_cpumask);
|
||||||
|
spdk_cpuset_set_cpu(&tmp_cpumask, i, true);
|
||||||
|
|
||||||
|
spdk_thread_create(thread_name, &tmp_cpumask);
|
||||||
}
|
}
|
||||||
spdk_cpuset_set_cpu(&g_reactor_core_mask, i, true);
|
spdk_cpuset_set_cpu(&g_reactor_core_mask, i, true);
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"cpumask": "$(S)",
|
"cpumask": "0x3",
|
||||||
"ctrlr": "vhost_scsi1",
|
"ctrlr": "vhost_scsi1",
|
||||||
"delay_base_us": 20,
|
"delay_base_us": 20,
|
||||||
"iops_threshold": 1000000,
|
"iops_threshold": 1000000,
|
||||||
|
Loading…
Reference in New Issue
Block a user