Commit 3fa5e0f3 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: optimise io_req_find_next() fast check

gcc 9.2.0 compiles io_req_find_next() as a separate function leaving
the first REQ_F_LINK_HEAD fast check not inlined. Help it by splitting
out the check from the function.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 0be0b0e3
...@@ -1664,12 +1664,9 @@ static void io_fail_links(struct io_kiocb *req) ...@@ -1664,12 +1664,9 @@ static void io_fail_links(struct io_kiocb *req)
io_cqring_ev_posted(ctx); io_cqring_ev_posted(ctx);
} }
static struct io_kiocb *io_req_find_next(struct io_kiocb *req) static struct io_kiocb *__io_req_find_next(struct io_kiocb *req)
{ {
if (likely(!(req->flags & REQ_F_LINK_HEAD)))
return NULL;
req->flags &= ~REQ_F_LINK_HEAD; req->flags &= ~REQ_F_LINK_HEAD;
if (req->flags & REQ_F_LINK_TIMEOUT) if (req->flags & REQ_F_LINK_TIMEOUT)
io_kill_linked_timeout(req); io_kill_linked_timeout(req);
...@@ -1685,6 +1682,13 @@ static struct io_kiocb *io_req_find_next(struct io_kiocb *req) ...@@ -1685,6 +1682,13 @@ static struct io_kiocb *io_req_find_next(struct io_kiocb *req)
return NULL; return NULL;
} }
static struct io_kiocb *io_req_find_next(struct io_kiocb *req)
{
if (likely(!(req->flags & REQ_F_LINK_HEAD)))
return NULL;
return __io_req_find_next(req);
}
static void __io_req_task_cancel(struct io_kiocb *req, int error) static void __io_req_task_cancel(struct io_kiocb *req, int error)
{ {
struct io_ring_ctx *ctx = req->ctx; struct io_ring_ctx *ctx = req->ctx;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment