Commit 0c6e1d7f authored by Hao Xu's avatar Hao Xu Committed by Jens Axboe

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: default avatarHao Xu <haoxu@linux.alibaba.com>
Reviewed-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20210825175856.194299-1-haoxu@linux.alibaba.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent aaa4db12
...@@ -6889,7 +6889,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr) ...@@ -6889,7 +6889,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
} }
sqe = io_get_sqe(ctx); sqe = io_get_sqe(ctx);
if (unlikely(!sqe)) { if (unlikely(!sqe)) {
kmem_cache_free(req_cachep, req); list_add(&req->inflight_entry, &ctx->submit_state.free_list);
break; break;
} }
/* will complete beyond this point, count as submitted */ /* will complete beyond this point, count as submitted */
......
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