Skip to content

Commit

Permalink
io_uring: clean io_req_find_next() fast check
Browse files Browse the repository at this point in the history
Indirectly io_req_find_next() is called for every request, optimise the
check by testing flags as it was long before -- __io_req_find_next()
tolerates false-positives well (i.e. link==NULL), and those should be
really rare.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Feb 12, 2021
1 parent dc0eced commit cdbff98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ static struct io_kiocb *__io_req_find_next(struct io_kiocb *req)

static inline struct io_kiocb *io_req_find_next(struct io_kiocb *req)
{
if (likely(!(req->link) && !(req->flags & REQ_F_LINK_TIMEOUT)))
if (likely(!(req->flags & (REQ_F_LINK|REQ_F_HARDLINK))))
return NULL;
return __io_req_find_next(req);
}
Expand Down

0 comments on commit cdbff98

Please sign in to comment.