Commit 490e8967 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: only force async punt if poll based retry can't handle it



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: default avatarJens Axboe <axboe@kernel.dk>
parent af197f50
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -2604,7 +2604,8 @@ static int io_read(struct io_kiocb *req, bool force_nonblock)
			if (ret)
			if (ret)
				goto out_free;
				goto out_free;
			/* any defer here is final, must blocking retry */
			/* 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;
				req->flags |= REQ_F_MUST_PUNT;
			return -EAGAIN;
			return -EAGAIN;
		}
		}
@@ -2726,6 +2727,7 @@ static int io_write(struct io_kiocb *req, bool force_nonblock)
			if (ret)
			if (ret)
				goto out_free;
				goto out_free;
			/* any defer here is final, must blocking retry */
			/* any defer here is final, must blocking retry */
			if (!file_can_poll(req->file))
				req->flags |= REQ_F_MUST_PUNT;
				req->flags |= REQ_F_MUST_PUNT;
			return -EAGAIN;
			return -EAGAIN;
		}
		}