[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/33] aio: remove aio_context_acquire()/aio_context_release() API
From: |
Kevin Wolf |
Subject: |
[PULL 24/33] aio: remove aio_context_acquire()/aio_context_release() API |
Date: |
Thu, 21 Dec 2023 22:23:29 +0100 |
From: Stefan Hajnoczi <stefanha@redhat.com>
Delete these functions because nothing calls these functions anymore.
I introduced these APIs in commit 98563fc3ec44 ("aio: add
aio_context_acquire() and aio_context_release()") in 2014. It's with a
sigh of relief that I delete these APIs almost 10 years later.
Thanks to Paolo Bonzini's vision for multi-queue QEMU, we got an
understanding of where the code needed to go in order to remove the
limitations that the original dataplane and the IOThread/AioContext
approach that followed it.
Emanuele Giuseppe Esposito had the splendid determination to convert
large parts of the codebase so that they no longer needed the AioContext
lock. This was a painstaking process, both in the actual code changes
required and the iterations of code review that Emanuele eked out of
Kevin and me over many months.
Kevin Wolf tackled multitudes of graph locking conversions to protect
in-flight I/O from run-time changes to the block graph as well as the
clang Thread Safety Analysis annotations that allow the compiler to
check whether the graph lock is being used correctly.
And me, well, I'm just here to add some pizzazz to the QEMU multi-queue
block layer :). Thank you to everyone who helped with this effort,
including Eric Blake, code reviewer extraordinaire, and others who I've
forgotten to mention.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-ID: <20231205182011.1976568-11-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
include/block/aio.h | 17 -----------------
util/async.c | 10 ----------
2 files changed, 27 deletions(-)
diff --git a/include/block/aio.h b/include/block/aio.h
index f08b358077..af05512a7d 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -278,23 +278,6 @@ void aio_context_ref(AioContext *ctx);
*/
void aio_context_unref(AioContext *ctx);
-/* Take ownership of the AioContext. If the AioContext will be shared between
- * threads, and a thread does not want to be interrupted, it will have to
- * take ownership around calls to aio_poll(). Otherwise, aio_poll()
- * automatically takes care of calling aio_context_acquire and
- * aio_context_release.
- *
- * Note that this is separate from bdrv_drained_begin/bdrv_drained_end. A
- * thread still has to call those to avoid being interrupted by the guest.
- *
- * Bottom halves, timers and callbacks can be created or removed without
- * acquiring the AioContext.
- */
-void aio_context_acquire(AioContext *ctx);
-
-/* Relinquish ownership of the AioContext. */
-void aio_context_release(AioContext *ctx);
-
/**
* aio_bh_schedule_oneshot_full: Allocate a new bottom half structure that will
* run only once and as soon as possible.
diff --git a/util/async.c b/util/async.c
index dfd44ef612..460529057c 100644
--- a/util/async.c
+++ b/util/async.c
@@ -719,16 +719,6 @@ void aio_context_unref(AioContext *ctx)
g_source_unref(&ctx->source);
}
-void aio_context_acquire(AioContext *ctx)
-{
- /* TODO remove this function */
-}
-
-void aio_context_release(AioContext *ctx)
-{
- /* TODO remove this function */
-}
-
QEMU_DEFINE_STATIC_CO_TLS(AioContext *, my_aiocontext)
AioContext *qemu_get_current_aio_context(void)
--
2.43.0
- [PULL 16/33] scsi: assert that callbacks run in the correct AioContext, (continued)
- [PULL 16/33] scsi: assert that callbacks run in the correct AioContext, Kevin Wolf, 2023/12/21
- [PULL 17/33] tests: remove aio_context_acquire() tests, Kevin Wolf, 2023/12/21
- [PULL 18/33] aio: make aio_context_acquire()/aio_context_release() a no-op, Kevin Wolf, 2023/12/21
- [PULL 19/33] graph-lock: remove AioContext locking, Kevin Wolf, 2023/12/21
- [PULL 22/33] scsi: remove AioContext locking, Kevin Wolf, 2023/12/21
- [PULL 20/33] block: remove AioContext locking, Kevin Wolf, 2023/12/21
- [PULL 21/33] block: remove bdrv_co_lock(), Kevin Wolf, 2023/12/21
- [PULL 23/33] aio-wait: draw equivalence between AIO_WAIT_WHILE() and AIO_WAIT_WHILE_UNLOCKED(), Kevin Wolf, 2023/12/21
- [PULL 25/33] docs: remove AioContext lock from IOThread docs, Kevin Wolf, 2023/12/21
- [PULL 26/33] scsi: remove outdated AioContext lock comment, Kevin Wolf, 2023/12/21
- [PULL 24/33] aio: remove aio_context_acquire()/aio_context_release() API,
Kevin Wolf <=
- [PULL 27/33] job: remove outdated AioContext locking comments, Kevin Wolf, 2023/12/21
- [PULL 28/33] block: remove outdated AioContext locking comments, Kevin Wolf, 2023/12/21
- [PULL 31/33] qdev-properties: alias all object class properties, Kevin Wolf, 2023/12/21
- [PULL 30/33] string-output-visitor: show structs as "<omitted>", Kevin Wolf, 2023/12/21
- [PULL 32/33] qdev: add IOThreadVirtQueueMappingList property type, Kevin Wolf, 2023/12/21
- [PULL 29/33] block-coroutine-wrapper: use qemu_get_current_aio_context(), Kevin Wolf, 2023/12/21
- [PULL 33/33] virtio-blk: add iothread-vq-mapping parameter, Kevin Wolf, 2023/12/21