Skip to content

Commit 3b763ba

Browse files
isilenceaxboe
authored andcommitted
io_uring: remove extra sqpoll submission halting
SQPOLL task won't submit requests for a context that is currently dying, so no need to remove ctx from sqd_list prior the main loop of io_ring_exit_work(). Kill it, will be removed by io_sq_thread_finish() and only brings confusion and lockups. Cc: [email protected] Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/f220c2b786ba0f9499bebc9f3cd9714d29efb6a5.1618752958.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 75c4021 commit 3b763ba

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

fs/io_uring.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6750,6 +6750,10 @@ static int __io_sq_thread(struct io_ring_ctx *ctx, bool cap_entries)
67506750
if (!list_empty(&ctx->iopoll_list))
67516751
io_do_iopoll(ctx, &nr_events, 0);
67526752

6753+
/*
6754+
* Don't submit if refs are dying, good for io_uring_register(),
6755+
* but also it is relied upon by io_ring_exit_work()
6756+
*/
67536757
if (to_submit && likely(!percpu_ref_is_dying(&ctx->refs)) &&
67546758
!(ctx->flags & IORING_SETUP_R_DISABLED))
67556759
ret = io_submit_sqes(ctx, to_submit);
@@ -8540,14 +8544,6 @@ static void io_ring_exit_work(struct work_struct *work)
85408544
struct io_tctx_node *node;
85418545
int ret;
85428546

8543-
/* prevent SQPOLL from submitting new requests */
8544-
if (ctx->sq_data) {
8545-
io_sq_thread_park(ctx->sq_data);
8546-
list_del_init(&ctx->sqd_list);
8547-
io_sqd_update_thread_idle(ctx->sq_data);
8548-
io_sq_thread_unpark(ctx->sq_data);
8549-
}
8550-
85518547
/*
85528548
* If we're doing polled IO and end up having requests being
85538549
* submitted async (out-of-line), then completions can come in while

0 commit comments

Comments
 (0)