[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v9 17/17] block/io_uring: enable kernel submission p
From: |
Aarushi Mehta |
Subject: |
[Qemu-devel] [PATCH v9 17/17] block/io_uring: enable kernel submission polling |
Date: |
Fri, 2 Aug 2019 05:10:31 +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 1553cd2e58..2a1d79704a 100644
--- a/block/io_uring.c
+++ b/block/io_uring.c
@@ -288,6 +288,17 @@ static int ioq_submit(LuringState *s)
*sqes = luringcb->sqeq;
QSIMPLEQ_REMOVE_HEAD(&s->io_q.submit_queue, next);
}
+ /*
+ * io_uring_submit() returns sqes in ring for kernel side
+ * submission polling and sets wakeup flag if needed.
+ *
+ * It is not possible for any sqes to have already been
+ * submitted by the sq_poll as the writes are only made visible
+ * to the kernel in this function.
+ *
+ * For normal I/O, it returns the actual submitted requests
+ * from io_uring_enter()
+ */
ret = io_uring_submit(&s->ring);
trace_luring_io_uring_submit(s, ret);
/* Prevent infinite loop if submission is refused */
@@ -525,7 +536,11 @@ LuringState *luring_init(Error **errp)
s = g_new0(LuringState, 1);
trace_luring_init_state(s, sizeof(*s));
struct io_uring *ring = &s->ring;
- rc = io_uring_queue_init(MAX_EVENTS, ring, 0);
+
+ rc = io_uring_queue_init(MAX_EVENTS, ring, IORING_SETUP_SQPOLL);
+ if (rc == -EOPNOTSUPP) {
+ rc = io_uring_queue_init(MAX_EVENTS, ring, 0);
+ }
if (rc < 0) {
error_setg_errno(errp, errno, "failed to init linux io_uring ring");
g_free(s);
--
2.21.0
- [Qemu-devel] [PATCH v9 10/17] block/io_uring: adds userspace completion polling, (continued)
- [Qemu-devel] [PATCH v9 10/17] block/io_uring: adds userspace completion polling, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 11/17] qemu-io: adds option to use aio engine, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 12/17] qemu-img: adds option to use aio engine for benchmarking, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 13/17] qemu-nbd: adds option for aio engines, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 14/17] tests/qemu-iotests: enable testing with aio options, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 15/17] tests/qemu-iotests: use AIOMODE with various tests, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 16/17] block/io_uring: adds fd registration, Aarushi Mehta, 2019/08/01
- [Qemu-devel] [PATCH v9 17/17] block/io_uring: enable kernel submission polling,
Aarushi Mehta <=