Skip to content

Commit

Permalink
aio: make aio_context_acquire()/aio_context_release() a no-op
Browse files Browse the repository at this point in the history
aio_context_acquire()/aio_context_release() has been replaced by
fine-grained locking to protect state shared by multiple threads. The
AioContext lock still plays the role of balancing locking in
AIO_WAIT_WHILE() and many functions in QEMU either require that the
AioContext lock is held or not held for this reason. In other words, the
AioContext lock is purely there for consistency with itself and serves
no real purpose anymore.

Stop actually acquiring/releasing the lock in
aio_context_acquire()/aio_context_release() so that subsequent patches
can remove callers across the codebase incrementally.

I have performed "make check" and qemu-iotests stress tests across
x86-64, ppc64le, and aarch64 to confirm that there are no failures as a
result of eliminating the lock.

Signed-off-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Acked-by: Kevin Wolf <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
stefanhaRH authored and kevmw committed Dec 21, 2023
1 parent b3496d1 commit b5f4fda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/async.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,12 @@ void aio_context_unref(AioContext *ctx)

void aio_context_acquire(AioContext *ctx)
{
qemu_rec_mutex_lock(&ctx->lock);
/* TODO remove this function */
}

void aio_context_release(AioContext *ctx)
{
qemu_rec_mutex_unlock(&ctx->lock);
/* TODO remove this function */
}

QEMU_DEFINE_STATIC_CO_TLS(AioContext *, my_aiocontext)
Expand Down

0 comments on commit b5f4fda

Please sign in to comment.