Commit b34883e0 authored by Ziye Yang's avatar Ziye Yang Committed by Tomasz Zawadzki
Browse files

accel_perf: Fix the memory leak issue of task free



When the task is allocated from _get_task function,
the task is removed from the tasks_pool in non batched mode.

So in _accel_done function, when the is_draining flag is true
and it is not a batched mode, we should add task back to the pool.
If not, the the memory related resource allocated by the task will
not be freed.

PS: In _check_draining function, the related resource of task
in the tasks_pool will be freed. However, if the task is not
added back, the resource free will not work as expected.

PS: The issue is reported by ASAN.

Signed-off-by: default avatarZiye Yang <ziye.yang@intel.com>
Change-Id: I981117037fba8e111987c771cae65bc06a734a6f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6097


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
parent 82240049
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -570,8 +570,9 @@ _accel_done(void *arg1)
		}
	} else if (g_ops_per_batch > 0) {
		_drain_batch(worker);
	} else {
		TAILQ_INSERT_TAIL(&worker->tasks_pool, task, link);
	}

}

static int