accel_perf: cycle tasks through task_pool

When a task completes, always put it back in the task
pool (using TAILQ_INSERT_TAIL) and then use _get_task
to get a task for the next submission.  Currently this
will just allocate the task that was just put into
the TAILQ.  But an upcoming patch will allocate
more tasks than we have queue depth, and this patch
will ensure all of those tasks get used evenly.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia6247a76ba60337fe6da3189e6c305f4dfb0a041
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8450
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
This commit is contained in:
Jim Harris 2021-06-21 18:06:28 +00:00
parent 4cd7ca9bc0
commit 451462f692

View File

@ -618,6 +618,8 @@ _accel_done(void *arg1)
worker->current_queue_depth--;
if (!worker->is_draining) {
TAILQ_INSERT_TAIL(&worker->tasks_pool, task, link);
task = _get_task(worker);
if (g_ops_per_batch == 0) {
_submit_single(worker, task);
worker->current_queue_depth++;