nvme/perf: store master core as global variable
This will be used in a future patch. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: Ie88daa20842f5f166b4a7a5abccafd6683d6da64 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473338 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
437dce1a5b
commit
3f2002eaba
@ -194,6 +194,7 @@ static struct ns_entry *g_namespaces = NULL;
|
|||||||
static int g_num_namespaces = 0;
|
static int g_num_namespaces = 0;
|
||||||
static struct worker_thread *g_workers = NULL;
|
static struct worker_thread *g_workers = NULL;
|
||||||
static int g_num_workers = 0;
|
static int g_num_workers = 0;
|
||||||
|
static uint32_t g_master_core;
|
||||||
|
|
||||||
static uint64_t g_tsc_rate;
|
static uint64_t g_tsc_rate;
|
||||||
|
|
||||||
@ -1993,7 +1994,6 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
struct worker_thread *worker, *master_worker;
|
struct worker_thread *worker, *master_worker;
|
||||||
unsigned master_core;
|
|
||||||
struct spdk_env_opts opts;
|
struct spdk_env_opts opts;
|
||||||
pthread_t thread_id = 0;
|
pthread_t thread_id = 0;
|
||||||
|
|
||||||
@ -2063,11 +2063,11 @@ int main(int argc, char **argv)
|
|||||||
printf("Initialization complete. Launching workers.\n");
|
printf("Initialization complete. Launching workers.\n");
|
||||||
|
|
||||||
/* Launch all of the slave workers */
|
/* Launch all of the slave workers */
|
||||||
master_core = spdk_env_get_current_core();
|
g_master_core = spdk_env_get_current_core();
|
||||||
master_worker = NULL;
|
master_worker = NULL;
|
||||||
worker = g_workers;
|
worker = g_workers;
|
||||||
while (worker != NULL) {
|
while (worker != NULL) {
|
||||||
if (worker->lcore != master_core) {
|
if (worker->lcore != g_master_core) {
|
||||||
spdk_env_thread_launch_pinned(worker->lcore, work_fn, worker);
|
spdk_env_thread_launch_pinned(worker->lcore, work_fn, worker);
|
||||||
} else {
|
} else {
|
||||||
assert(master_worker == NULL);
|
assert(master_worker == NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user