提交 4319a66f 编写于 作者: J Jens Axboe 提交者: Joseph Qi

io_uring: run next sqe inline if possible

to #26323578

commit 4a0a7a187453e65bdd24b9ede045b4c36b958868 upstream.

One major use case of linked commands is the ability to run the next
link inline, if at all possible. This is done correctly for async
offload, but somewhere along the line we lost the ability to do so when
we were able to complete a request without having to punt it. Ensure
that we do so correctly.
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
Acked-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
上级 c1f967d5
......@@ -3220,13 +3220,14 @@ static struct io_kiocb *io_prep_linked_timeout(struct io_kiocb *req)
static void __io_queue_sqe(struct io_kiocb *req)
{
struct io_kiocb *linked_timeout = io_prep_linked_timeout(req);
struct io_kiocb *linked_timeout;
struct io_kiocb *nxt = NULL;
int ret;
again:
linked_timeout = io_prep_linked_timeout(req);
ret = io_issue_sqe(req, &nxt, true);
if (nxt)
io_queue_async_work(nxt);
/*
* We async punt it if the file wasn't marked NOWAIT, or if the file
......@@ -3245,7 +3246,7 @@ static void __io_queue_sqe(struct io_kiocb *req)
* submit reference when the iocb is actually submitted.
*/
io_queue_async_work(req);
return;
goto done_req;
}
err:
......@@ -3265,6 +3266,12 @@ static void __io_queue_sqe(struct io_kiocb *req)
req_set_fail_links(req);
io_put_req(req);
}
done_req:
if (nxt) {
req = nxt;
nxt = NULL;
goto again;
}
}
static void io_queue_sqe(struct io_kiocb *req)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册