提交 8629397e 编写于 作者: J Jens Axboe

io_uring: don't use complete_all() on SQPOLL thread exit

We want to reuse this completion, and a single complete should do just
fine. Ensure that we park ourselves first if requested, as that is what
lead to the initial deadlock in this area. If we've got someone attempting
to park us, then we can't proceed without having them finish first.

Fixes: 37d1e2e3 ("io_uring: move SQPOLL thread io-wq forked worker")
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 ba50a036
...@@ -6783,10 +6783,13 @@ static int io_sq_thread(void *data) ...@@ -6783,10 +6783,13 @@ static int io_sq_thread(void *data)
io_run_task_work(); io_run_task_work();
if (io_sq_thread_should_park(sqd))
io_sq_thread_parkme(sqd);
/* /*
* Clear thread under lock so that concurrent parks work correctly * Clear thread under lock so that concurrent parks work correctly
*/ */
complete_all(&sqd->completion); complete(&sqd->completion);
mutex_lock(&sqd->lock); mutex_lock(&sqd->lock);
sqd->thread = NULL; sqd->thread = NULL;
list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) { list_for_each_entry(ctx, &sqd->ctx_list, sqd_list) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册