aboutsummaryrefslogtreecommitdiff
path: root/include/block/aio-wait.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-03-03 11:03:52 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-03-07 12:39:50 +0100
commitb532526a07ef3b903ead2e055fe6cc87b41057a3 (patch)
tree34054b0a98fb09f532a0cb31494f4a20d85efbd1 /include/block/aio-wait.h
parent2482aeea4195ad84cf3d4e5b15b28ec5b420ed5a (diff)
aio-wait: switch to smp_mb__after_rmw()
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> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/block/aio-wait.h')
-rw-r--r--include/block/aio-wait.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/block/aio-wait.h b/include/block/aio-wait.h
index dd9a7f6461..da13357bb8 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); \