]> Git Repo - linux.git/commitdiff
io_uring: perform IOPOLL reaping if canceler is thread itself
authorJens Axboe <[email protected]>
Thu, 11 Mar 2021 17:49:20 +0000 (10:49 -0700)
committerJens Axboe <[email protected]>
Thu, 11 Mar 2021 17:49:20 +0000 (10:49 -0700)
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: 9936c7c2bc76 ("io_uring: deduplicate core cancellations sequence")
Signed-off-by: Jens Axboe <[email protected]>
fs/io_uring.c

index 472eab7359f2a26c9d3c60e6be5e4653089f9c81..49f85f49e1c3c2aac5383f5d1dc2abf8122a238a 100644 (file)
@@ -8658,7 +8658,8 @@ static void io_uring_try_cancel_requests(struct io_ring_ctx *ctx,
                }
 
                /* 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)) {
                                io_iopoll_try_reap_events(ctx);
                                ret = true;
This page took 0.093942 seconds and 4 git commands to generate.