[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 10/14] block/io_uring: adds userspace completion
From: |
Aarushi Mehta |
Subject: |
[Qemu-devel] [PATCH v6 10/14] block/io_uring: adds userspace completion polling |
Date: |
Fri, 19 Jul 2019 19:05:26 +0530 |
Signed-off-by: Aarushi Mehta <address@hidden>
---
block/io_uring.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/block/io_uring.c b/block/io_uring.c
index e9c1dc1dc7..de2a037151 100644
--- a/block/io_uring.c
+++ b/block/io_uring.c
@@ -237,6 +237,21 @@ static void qemu_luring_completion_cb(void *opaque)
luring_process_completions_and_submit(s);
}
+static bool qemu_luring_poll_cb(void *opaque)
+{
+ LuringState *s = opaque;
+ struct io_uring_cqe *cqes;
+
+ if (io_uring_peek_cqe(&s->ring, &cqes) == 0) {
+ if (cqes) {
+ luring_process_completions_and_submit(s);
+ return true;
+ }
+ }
+
+ return false;
+}
+
static void ioq_init(LuringQueue *io_q)
{
QSIMPLEQ_INIT(&io_q->sq_overflow);
@@ -394,7 +409,7 @@ void luring_attach_aio_context(LuringState *s, AioContext
*new_context)
s->aio_context = new_context;
s->completion_bh = aio_bh_new(new_context, qemu_luring_completion_bh, s);
aio_set_fd_handler(s->aio_context, s->ring.ring_fd, false,
- qemu_luring_completion_cb, NULL, NULL, s);
+ qemu_luring_completion_cb, NULL, qemu_luring_poll_cb,
s);
}
LuringState *luring_init(Error **errp)
--
2.21.0
- [Qemu-devel] [PATCH v6 04/14] block/io_uring: implements interfaces for io_uring, (continued)
- [Qemu-devel] [PATCH v6 04/14] block/io_uring: implements interfaces for io_uring, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 05/14] stubs: add stubs for io_uring interface, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 06/14] util/async: add aio interfaces for io_uring, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 07/14] blockdev: accept io_uring as option, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 08/14] block/file-posix.c: extend to use io_uring, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 09/14] block: add trace events for io_uring, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 10/14] block/io_uring: adds userspace completion polling,
Aarushi Mehta <=
- [Qemu-devel] [PATCH v6 11/14] qemu-io: adds option to use aio engine, Aarushi Mehta, 2019/07/19
- Re: [Qemu-devel] [PATCH v6 11/14] qemu-io: adds option to use aio engine, Julia Suvorova, 2019/07/24
- [Qemu-devel] [PATCH v6 12/14] qemu-img: adds option to use aio engine, Aarushi Mehta, 2019/07/19
- [Qemu-devel] [PATCH v6 13/14] qemu-nbd: adds option for aio engines, Aarushi Mehta, 2019/07/19