Commit d052d1d6 authored by Jens Axboe's avatar Jens Axboe

io_uring: perform IOPOLL reaping if canceler is thread itself

We bypass IOPOLL completion polling (and reaping) for the SQPOLL thread,
but if it's the thread itself invoking cancelations, then we still need
to perform it or no one will.

Fixes: 9936c7c2 ("io_uring: deduplicate core cancellations sequence")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5c2469e0
...@@ -8658,7 +8658,8 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx, ...@@ -8658,7 +8658,8 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
} }
/* SQPOLL thread does its own polling */ /* SQPOLL thread does its own polling */
if (!(ctx->flags & IORING_SETUP_SQPOLL) && !files) { if ((!(ctx->flags & IORING_SETUP_SQPOLL) && !files) ||
(ctx->sq_data && ctx->sq_data->thread == current)) {
while (!list_empty_careful(&ctx->iopoll_list)) { while (!list_empty_careful(&ctx->iopoll_list)) {
io_iopoll_try_reap_events(ctx); io_iopoll_try_reap_events(ctx);
ret = true; ret = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment