Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: remove drain prealloc checks

Currently io_drain_req() has two steps. The first is fast path checking
sequence numbers. The second is allocations, rechecking and actual
queuing. Further simplify it by removing the first step.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/4d06e89ed07611993d7bf89182de2300858379bd.1746788718.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
e91e4f69 05b33411

+3 -12
+3 -12
io_uring/io_uring.c
··· 1674 1674 struct io_defer_entry *de; 1675 1675 u32 seq = io_get_sequence(req); 1676 1676 1677 - /* Still need defer if there is pending req in defer list. */ 1678 - spin_lock(&ctx->completion_lock); 1679 - if (!req_need_defer(req, seq) && list_empty_careful(&ctx->defer_list)) { 1680 - spin_unlock(&ctx->completion_lock); 1681 - queue: 1682 - ctx->drain_active = false; 1683 - io_req_task_queue(req); 1684 - return; 1685 - } 1686 - spin_unlock(&ctx->completion_lock); 1687 - 1688 1677 io_prep_async_link(req); 1689 1678 de = kmalloc(sizeof(*de), GFP_KERNEL_ACCOUNT); 1690 1679 if (!de) { ··· 1685 1696 if (!req_need_defer(req, seq) && list_empty(&ctx->defer_list)) { 1686 1697 spin_unlock(&ctx->completion_lock); 1687 1698 kfree(de); 1688 - goto queue; 1699 + ctx->drain_active = false; 1700 + io_req_task_queue(req); 1701 + return; 1689 1702 } 1690 1703 1691 1704 trace_io_uring_defer(req);