diff options
author | Hao Xu <haoxu@linux.alibaba.com> | 2021-08-25 19:58:56 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-25 21:04:26 +0200 |
commit | 0c6e1d7fd5e7560fdc4bb3418c2c0f0d7a95bf76 (patch) | |
tree | 14c23e2dfff98201b852fa023d6b9459b750120f /fs/io_uring.c | |
parent | io_uring: accept directly into fixed file table (diff) | |
download | linux-0c6e1d7fd5e7560fdc4bb3418c2c0f0d7a95bf76.tar.xz linux-0c6e1d7fd5e7560fdc4bb3418c2c0f0d7a95bf76.zip |
io_uring: don't free request to slab
It's not necessary to free the request back to slab when we fail to
get sqe, just move it to state->free_list.
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20210825175856.194299-1-haoxu@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r-- | fs/io_uring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index e321cb0d00c4..be3c3aea6398 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6889,7 +6889,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr) } sqe = io_get_sqe(ctx); if (unlikely(!sqe)) { - kmem_cache_free(req_cachep, req); + list_add(&req->inflight_entry, &ctx->submit_state.free_list); break; } /* will complete beyond this point, count as submitted */ |