summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorHao Xu <haoxu@linux.alibaba.com>2021-04-24 17:26:20 +0800
committerJens Axboe <axboe@kernel.dk>2021-04-25 10:14:25 -0600
commit2b4ae19c6d4842dc24d9e0cbec5c98d2766643d5 (patch)
tree79d2f3c28041d79a3ead766a7ea2a5ca33427e4b /fs/io_uring.c
parent634d00df5e1cfc4a707b629a814bd607f726bd52 (diff)
io_uring: update sq_thread_idle after ctx deleted
we shall update sq_thread_idle anytime we do ctx deletion from ctx_list Fixes:734551df6f9b ("io_uring: fix shared sqpoll cancellation hangs") Signed-off-by: Hao Xu <haoxu@linux.alibaba.com> Link: https://lore.kernel.org/r/1619256380-236460-1-git-send-email-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0ab09f7a44e7..be2be0530798 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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);