Commit 1ba93e61 authored by Jim Harris's avatar Jim Harris Committed by Daniel Verkamp
Browse files

bdev: eliminate memset in spdk_bdev_get_io



Most relevant fields get initialized after the structure
is returned to the caller, so this memset is just
wasting CPU cycles.

buf still needs to be set to NULL, so just set that
field explicitly.

bdevperf with null backend shows a 10% improvement
with this patch.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I92ef0ea887f1307abdcd4b80bc08b45ccefe27d9

Reviewed-on: https://review.gerrithub.io/393714


Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatar <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
parent e4bfb3d1
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -753,8 +753,6 @@ spdk_bdev_get_io(struct spdk_io_channel *_ch)
		}
	}

	memset(bdev_io, 0, offsetof(struct spdk_bdev_io, u));

	return bdev_io;
}

@@ -826,6 +824,7 @@ spdk_bdev_io_init(struct spdk_bdev_io *bdev_io,
	bdev_io->cb = cb;
	bdev_io->status = SPDK_BDEV_IO_STATUS_PENDING;
	bdev_io->in_submit_request = false;
	bdev_io->buf = NULL;
}

bool