Commit aa3df274 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

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: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8816b28625869662c6b9124036b619b76bf96a3c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478709


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarSeth Howell <seth.howell@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 1d004809
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
		}