[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/9] aio-wait: switch to smp_mb__after_rmw()
From: |
Paolo Bonzini |
Subject: |
[PATCH v2 5/9] aio-wait: switch to smp_mb__after_rmw() |
Date: |
Mon, 6 Mar 2023 23:33:02 +0100 |
The barrier comes after an atomic increment, so it is enough to use
smp_mb__after_rmw(); this avoids a double barrier on x86 systems.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/block/aio-wait.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/block/aio-wait.h b/include/block/aio-wait.h
index dd9a7f6461ef..da13357bb8cf 100644
--- a/include/block/aio-wait.h
+++ b/include/block/aio-wait.h
@@ -85,7 +85,7 @@ extern AioWait global_aio_wait;
/* Increment wait_->num_waiters before evaluating cond. */ \
qatomic_inc(&wait_->num_waiters); \
/* Paired with smp_mb in aio_wait_kick(). */ \
- smp_mb(); \
+ smp_mb__after_rmw(); \
if (ctx_ && in_aio_context_home_thread(ctx_)) { \
while ((cond)) { \
aio_poll(ctx_, true); \
--
2.39.1
- [PATCH v2 0/9] Fix missing memory barriers on ARM, Paolo Bonzini, 2023/03/06
- [PATCH v2 1/9] qatomic: add smp_mb__before/after_rmw(), Paolo Bonzini, 2023/03/06
- [PATCH v2 2/9] qemu-thread-posix: cleanup, fix, document QemuEvent, Paolo Bonzini, 2023/03/06
- [PATCH v2 3/9] qemu-thread-win32: cleanup, fix, document QemuEvent, Paolo Bonzini, 2023/03/06
- [PATCH v2 4/9] edu: add smp_mb__after_rmw(), Paolo Bonzini, 2023/03/06
- [PATCH v2 5/9] aio-wait: switch to smp_mb__after_rmw(),
Paolo Bonzini <=
- [PATCH v2 6/9] qemu-coroutine-lock: add smp_mb__after_rmw(), Paolo Bonzini, 2023/03/06
- [PATCH v2 7/9] physmem: add missing memory barrier, Paolo Bonzini, 2023/03/06
- [PATCH v2 8/9] async: update documentation of the memory barriers, Paolo Bonzini, 2023/03/06