[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/18] block/io_uring: adds userspace completion polling
From: |
Stefan Hajnoczi |
Subject: |
[PULL 13/18] block/io_uring: adds userspace completion polling |
Date: |
Thu, 30 Jan 2020 21:31:09 +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>
---
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 a5c0d16220..56892fd1ab 100644
--- a/block/io_uring.c
+++ b/block/io_uring.c
@@ -274,6 +274,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->submit_queue);
@@ -387,7 +402,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.24.1
- [PULL 03/18] block/io: take bs->reqs_lock in bdrv_mark_request_serialising, (continued)
- [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 08/18] stubs: add stubs for io_uring interface, Stefan Hajnoczi, 2020/01/30
- [PULL 10/18] blockdev: adds bdrv_parse_aio to use io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 07/18] block/io_uring: implements interfaces for 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 09/18] util/async: add aio interfaces for io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 12/18] block: add trace events for io_uring, Stefan Hajnoczi, 2020/01/30
- [PULL 13/18] block/io_uring: adds userspace completion polling,
Stefan Hajnoczi <=
- [PULL 14/18] qemu-io: adds option to use aio engine, 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