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: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: Idd65f74567c594e5a6514a4ab0665b8f3606c883
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463455
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Richael Zhuang 2019-07-29 13:44:04 +08:00 committed by Jim Harris
parent 0f6991519d
commit b2101c9a5c

View File

@ -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;