Commit 49be050e authored by Jim Harris's avatar Jim Harris Committed by Tomasz Zawadzki
Browse files

sock: remove DEBUG from spdk_sock_request definition



spdk_sock_request has a curr_list member which is
only used for debugging sock_requests to their
list associations. It is only defined in DEBUG builds
though. This means that debug and release builds have
a different ABI for the sock library.

Always including it should have minimal performance
degradation. The size of spdk_sock_request itself
(not including trailing iovecs) is 24 bytes, with the
curr_list, it is 32 bytes.

curr_list is 8 bytes, and spdk_sock_request is 8-byte
aligned (not necessarily cache-line-aligned since it is
embedded in other structures). So adding the 8 bytes
could cause this structure to spill into a new cache
line.

So roughly 1-in-8 spdk_sock_request uses will incur
an extra cacheline hit.

Fixes issue #3096.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I00259759bf73c0059a4abb28ba1173bae1da58c8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19752


Reviewed-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 15bff974
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -48,9 +48,14 @@ struct spdk_sock_request {
	 */
	struct __sock_request_internal {
		TAILQ_ENTRY(spdk_sock_request)	link;
#ifdef DEBUG

		/**
		 * curr_list is only used in DEBUG mode, but we include it in
		 * release builds too to ensure ABI compatibility between debug
		 * and release builds.
		 */
		void				*curr_list;
#endif

		uint32_t			offset;

		/* Indicate if the whole req or part of it is sent with zerocopy */