Skip to content

Commit

Permalink
io_uring: only force async punt if poll based retry can't handle it
Browse files Browse the repository at this point in the history
We do blocking retry from our poll handler, if the file supports polled
notifications. Only mark the request as needing an async worker if we
can't poll for it.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed May 1, 2020
1 parent af197f5 commit 490e896
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2604,7 +2604,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock)
if (ret)
goto out_free;
/* any defer here is final, must blocking retry */
if (!(req->flags & REQ_F_NOWAIT))
if (!(req->flags & REQ_F_NOWAIT) &&
!file_can_poll(req->file))
req->flags |= REQ_F_MUST_PUNT;
return -EAGAIN;
}
Expand Down Expand Up @@ -2726,7 +2727,8 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)
if (ret)
goto out_free;
/* any defer here is final, must blocking retry */
req->flags |= REQ_F_MUST_PUNT;
if (!file_can_poll(req->file))
req->flags |= REQ_F_MUST_PUNT;
return -EAGAIN;
}
}
Expand Down

0 comments on commit 490e896

Please sign in to comment.