aio_wait_kick: add missing memory barrier
commit7455ff1aa01564cc175db5b2373e610503ad4411
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Tue, 24 May 2022 17:30:54 +0000 (24 13:30 -0400)
committerKevin Wolf <kwolf@redhat.com>
Fri, 24 Jun 2022 15:07:06 +0000 (24 17:07 +0200)
tree5a10d1498410ecbd582c7423d305188967600fc2
parent9b38fc56c054c7de65fa3bf7cdd82b32654f6b7d
aio_wait_kick: add missing memory barrier

It seems that aio_wait_kick always required a memory barrier
or atomic operation in the caller, but nobody actually
took care of doing it.

Let's put the barrier in the function instead, and pair it
with another one in AIO_WAIT_WHILE. Read aio_wait_kick()
comment for further explanation.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220524173054.12651-1-eesposit@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
include/block/aio-wait.h
util/aio-wait.c