提交 2b4ae19c 编写于 作者: H Hao Xu 提交者: Jens Axboe

io_uring: update sq_thread_idle after ctx deleted

we shall update sq_thread_idle anytime we do ctx deletion from ctx_list

Fixes:734551df ("io_uring: fix shared sqpoll cancellation hangs")
Signed-off-by: NHao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/1619256380-236460-1-git-send-email-haoxu@linux.alibaba.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 634d00df
......@@ -9018,6 +9018,7 @@ static void io_sqpoll_cancel_cb(struct callback_head *cb)
if (sqd->thread)
io_uring_cancel_sqpoll(sqd);
list_del_init(&work->ctx->sqd_list);
io_sqd_update_thread_idle(sqd);
complete(&work->completion);
}
......@@ -9028,7 +9029,6 @@ static void io_sqpoll_cancel_sync(struct io_ring_ctx *ctx)
struct task_struct *task;
io_sq_thread_park(sqd);
io_sqd_update_thread_idle(sqd);
task = sqd->thread;
if (task) {
init_completion(&work.completion);
......@@ -9037,6 +9037,7 @@ static void io_sqpoll_cancel_sync(struct io_ring_ctx *ctx)
wake_up_process(task);
} else {
list_del_init(&ctx->sqd_list);
io_sqd_update_thread_idle(sqd);
}
io_sq_thread_unpark(sqd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册