提交 daffeb02 编写于 作者: A Aarushi Mehta 提交者: Stefan Hajnoczi

block/io_uring: adds userspace completion polling

Signed-off-by: NAarushi Mehta <mehta.aaru20@gmail.com>
Acked-by: NStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Message-id: 20200120141858.587874-11-stefanha@redhat.com
Message-Id: <20200120141858.587874-11-stefanha@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 d803f590
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册