Commit bf6182b6 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: optimise io_rw_reissue()

The hot path is IO completing on the first try. Reshuffle io_rw_reissue() so
it's checked first.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 00835dce
...@@ -2738,12 +2738,13 @@ static bool io_resubmit_prep(struct io_kiocb *req, int error) ...@@ -2738,12 +2738,13 @@ static bool io_resubmit_prep(struct io_kiocb *req, int error)
static bool io_rw_reissue(struct io_kiocb *req, long res) static bool io_rw_reissue(struct io_kiocb *req, long res)
{ {
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
umode_t mode = file_inode(req->file)->i_mode; umode_t mode;
int ret; int ret;
if (!S_ISBLK(mode) && !S_ISREG(mode)) if (res != -EAGAIN && res != -EOPNOTSUPP)
return false; return false;
if ((res != -EAGAIN && res != -EOPNOTSUPP) || io_wq_current_is_worker()) mode = file_inode(req->file)->i_mode;
if ((!S_ISBLK(mode) && !S_ISREG(mode)) || io_wq_current_is_worker())
return false; return false;
lockdep_assert_held(&req->ctx->uring_lock); lockdep_assert_held(&req->ctx->uring_lock);
......
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