From: Paolo Bonzini Date: Fri, 3 Mar 2023 10:03:52 +0000 (+0100) Subject: aio-wait: switch to smp_mb__after_rmw() X-Git-Tag: v8.0.0-rc0~21^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b532526a07ef3b903ead2e055fe6cc87b41057a3;p=thirdparty%2Fqemu.git 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 Reviewed-by: David Hildenbrand Signed-off-by: Paolo Bonzini --- diff --git a/include/block/aio-wait.h b/include/block/aio-wait.h index dd9a7f6461e..da13357bb8c 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); \