bdevperf: Call put_io_channel on the core which called get_io_channel

spdk_put_io_channel() sends message if the core on which it is
called is different from the core which called spdk_get_io_channel().

However, ch->ref is guarded by mutex at free and we should call
spdk_put_io_channel() on the core which called spdk_get_io_channel()
as possible as we can.

Hence move spdk_put_io_channel() from end_run() to bdevperf_complete().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8816b28625869662c6b9124036b619b76bf96a3c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478709
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-12-22 23:36:56 -05:00 committed by Tomasz Zawadzki
parent 1d0048097d
commit aa3df27439

View File

@ -434,7 +434,6 @@ end_run(void *arg1, void *arg2)
struct io_target *target = arg1;
int rc = 0;
spdk_put_io_channel(target->ch);
spdk_bdev_close(target->bdev_desc);
if (--g_target_count == 0) {
if (g_show_performance_real_time) {
@ -531,6 +530,7 @@ bdevperf_complete(struct spdk_bdev_io *bdev_io, bool success, void *cb_arg)
} else {
TAILQ_INSERT_TAIL(&target->task_list, task, link);
if (target->current_queue_depth == 0) {
spdk_put_io_channel(target->ch);
complete = spdk_event_allocate(g_master_core, end_run, target, NULL);
spdk_event_call(complete);
}