diff options
author | Jens Axboe <axboe@kernel.dk> | 2022-03-23 09:30:05 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-24 07:19:57 +0100 |
commit | 96ccba4a1a59ae6bcfed405961dd399c74d0b2f8 (patch) | |
tree | 8a9ab5b1b7863a0a9bb2ec3f3584d4d67c0d51ff /io_uring | |
parent | aadd9b093018183c7895aa07395b786bc71c3d31 (diff) | |
download | linux-stable-96ccba4a1a59ae6bcfed405961dd399c74d0b2f8.tar.gz linux-stable-96ccba4a1a59ae6bcfed405961dd399c74d0b2f8.tar.bz2 linux-stable-96ccba4a1a59ae6bcfed405961dd399c74d0b2f8.zip |
io_uring: add flag for disabling provided buffer recycling
commit 8a3e8ee56417f5e0e66580d93941ed9d6f4c8274 upstream.
If we need to continue doing this IO, then we don't want a potentially
selected buffer recycled. Add a flag for that.
Set this for recv/recvmsg if they do partial IO.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/io_uring.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 3d67b9b4100f..7f9fb0cb9230 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -740,6 +740,7 @@ enum { REQ_F_CREDS_BIT, REQ_F_REFCOUNT_BIT, REQ_F_ARM_LTIMEOUT_BIT, + REQ_F_PARTIAL_IO_BIT, /* keep async read/write and isreg together and in order */ REQ_F_NOWAIT_READ_BIT, REQ_F_NOWAIT_WRITE_BIT, @@ -795,6 +796,8 @@ enum { REQ_F_REFCOUNT = BIT(REQ_F_REFCOUNT_BIT), /* there is a linked timeout that has to be armed */ REQ_F_ARM_LTIMEOUT = BIT(REQ_F_ARM_LTIMEOUT_BIT), + /* request has already done partial IO */ + REQ_F_PARTIAL_IO = BIT(REQ_F_PARTIAL_IO_BIT), }; struct async_poll { @@ -4963,6 +4966,7 @@ static int io_recvmsg(struct io_kiocb *req, unsigned int issue_flags) ret = -EINTR; if (ret > 0 && io_net_retry(sock, flags)) { sr->done_io += ret; + req->flags |= REQ_F_PARTIAL_IO; return io_setup_async_msg(req, kmsg); } req_set_fail(req); @@ -5036,6 +5040,7 @@ out_free: sr->len -= ret; sr->buf += ret; sr->done_io += ret; + req->flags |= REQ_F_PARTIAL_IO; return -EAGAIN; } req_set_fail(req); |