[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/18] util/async: add aio interfaces for io_uring
From: |
Stefan Hajnoczi |
Subject: |
[PULL 09/18] util/async: add aio interfaces for io_uring |
Date: |
Thu, 30 Jan 2020 21:31:05 +0000 |
From: Aarushi Mehta <address@hidden>
Signed-off-by: Aarushi Mehta <address@hidden>
Acked-by: Stefano Garzarella <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Message-Id: <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
util/async.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/util/async.c b/util/async.c
index b1fa5319e5..c192a24a61 100644
--- a/util/async.c
+++ b/util/async.c
@@ -276,6 +276,14 @@ aio_ctx_finalize(GSource *source)
}
#endif
+#ifdef CONFIG_LINUX_IO_URING
+ if (ctx->linux_io_uring) {
+ luring_detach_aio_context(ctx->linux_io_uring, ctx);
+ luring_cleanup(ctx->linux_io_uring);
+ ctx->linux_io_uring = NULL;
+ }
+#endif
+
assert(QSLIST_EMPTY(&ctx->scheduled_coroutines));
qemu_bh_delete(ctx->co_schedule_bh);
@@ -340,6 +348,29 @@ LinuxAioState *aio_get_linux_aio(AioContext *ctx)
}
#endif
+#ifdef CONFIG_LINUX_IO_URING
+LuringState *aio_setup_linux_io_uring(AioContext *ctx, Error **errp)
+{
+ if (ctx->linux_io_uring) {
+ return ctx->linux_io_uring;
+ }
+
+ ctx->linux_io_uring = luring_init(errp);
+ if (!ctx->linux_io_uring) {
+ return NULL;
+ }
+
+ luring_attach_aio_context(ctx->linux_io_uring, ctx);
+ return ctx->linux_io_uring;
+}
+
+LuringState *aio_get_linux_io_uring(AioContext *ctx)
+{
+ assert(ctx->linux_io_uring);
+ return ctx->linux_io_uring;
+}
+#endif
+
void aio_notify(AioContext *ctx)
{
/* Write e.g. bh->scheduled before reading ctx->notify_me. Pairs
@@ -434,6 +465,11 @@ AioContext *aio_context_new(Error **errp)
#ifdef CONFIG_LINUX_AIO
ctx->linux_aio = NULL;
#endif
+
+#ifdef CONFIG_LINUX_IO_URING
+ ctx->linux_io_uring = NULL;
+#endif
+
ctx->thread_pool = NULL;
qemu_rec_mutex_init(&ctx->lock);
timerlistgroup_init(&ctx->tlg, aio_timerlist_notify, ctx);
--
2.24.1
- [PULL 00/18] Block patches, Stefan Hajnoczi, 2020/01/30
- [PULL 01/18] block: eliminate BDRV_REQ_NO_SERIALISING, Stefan Hajnoczi, 2020/01/30
- [PULL 02/18] block/io: wait for serialising requests when a request becomes serialising, Stefan Hajnoczi, 2020/01/30
- [PULL 03/18] block/io: take bs->reqs_lock in bdrv_mark_request_serialising, Stefan Hajnoczi, 2020/01/30
- [PULL 04/18] configure: permit use of io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 05/18] qapi/block-core: add option for io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 06/18] block/block: add BDRV flag for io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 07/18] block/io_uring: implements interfaces for io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 08/18] stubs: add stubs for io_uring interface, Stefan Hajnoczi, 2020/01/30
- [PULL 09/18] util/async: add aio interfaces for io_uring,
Stefan Hajnoczi <=
- [PULL 10/18] blockdev: adds bdrv_parse_aio to use io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 11/18] block/file-posix.c: extend to use io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 12/18] block: add trace events for io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 14/18] qemu-io: adds option to use aio engine, Stefan Hajnoczi, 2020/01/30
- [PULL 13/18] block/io_uring: adds userspace completion polling, Stefan Hajnoczi, 2020/01/30
- [PULL 15/18] qemu-img: adds option to use aio engine for benchmarking, Stefan Hajnoczi, 2020/01/30
- [PULL 16/18] qemu-nbd: adds option for aio engines, Stefan Hajnoczi, 2020/01/30
- [PULL 17/18] tests/qemu-iotests: enable testing with aio options, Stefan Hajnoczi, 2020/01/30
- [PULL 18/18] tests/qemu-iotests: use AIOMODE with various tests, Stefan Hajnoczi, 2020/01/30
- Re: [PULL 00/18] Block patches, Peter Maydell, 2020/01/31