accel_perf: assign task->worker when building tasks_pool
Previously we would only assign the worker in _get_task(). But future patches will use _get_task() for each I/O, not just during startup. Also increment the current_queue_depth during startup only, rather than every time _get_task() is called. Signed-off-by: Jim Harris <james.r.harris@intel.com> Change-Id: I2713591d36b8353eaab8119ee230261f40857019 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8449 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
127fc0d0c3
commit
4cd7ca9bc0
@ -318,8 +318,6 @@ _get_task(struct worker_thread *worker)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
task->worker = worker;
|
||||
task->worker->current_queue_depth++;
|
||||
return task;
|
||||
}
|
||||
|
||||
@ -814,6 +812,7 @@ _init_thread(void *arg1)
|
||||
task = worker->task_base;
|
||||
for (i = 0; i < num_tasks; i++) {
|
||||
TAILQ_INSERT_TAIL(&worker->tasks_pool, task, link);
|
||||
task->worker = worker;
|
||||
if (_get_task_data_bufs(task)) {
|
||||
fprintf(stderr, "Unable to get data bufs\n");
|
||||
goto error;
|
||||
@ -844,6 +843,7 @@ _init_thread(void *arg1)
|
||||
|
||||
for (i = 0; i < g_ops_per_batch; i++) {
|
||||
task = _get_task(worker);
|
||||
worker->current_queue_depth++;
|
||||
if (task == NULL) {
|
||||
goto error;
|
||||
}
|
||||
@ -873,6 +873,7 @@ _init_thread(void *arg1)
|
||||
/* Submit as singles when no batching is enabled or we ran out of batches. */
|
||||
for (i = 0; i < remaining; i++) {
|
||||
task = _get_task(worker);
|
||||
worker->current_queue_depth++;
|
||||
if (task == NULL) {
|
||||
goto error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user