Commit b2101c9a authored by Richael Zhuang's avatar Richael Zhuang Committed by Jim Harris
Browse files

bdev: replace spdk_mb with spdk_smp_mb



For aarch64 spdk_mb is defined as "__asm volatile("dsb sy" ::: "memory")"
and spdk_smp_mb is defined as "__asm volatile("dmb ish" ::: "memory")".
"dsb sy" completes when all instructions before this instruction complete.
And "dmb ish" only keeps the order of memory access instructions before
and after it. It doesn't affect the ordering of any other instructions.
Here I think "dmb ish" is enough.

And replace spdk_mb with spdk_smp_mb here will not affect PPC64, X86_64
and i386.

Signed-off-by: default avatarRichael Zhuang <richael.zhuang@arm.com>
Change-Id: Idd65f74567c594e5a6514a4ab0665b8f3606c883
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463455


Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 0f699151
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ bdev_user_io_getevents(io_context_t io_ctx, unsigned int max, struct io_event *u
#if defined(__i386__) || defined(__x86_64__)
	spdk_compiler_barrier();
#else
	spdk_mb();
	spdk_smp_mb();
#endif
	ring->head = (head + count) % ring->size;