summaryrefslogtreecommitdiffstats
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-09-07 14:50:07 +0200
committerJens Axboe <axboe@kernel.dk>2023-09-07 17:02:27 +0200
commit45500dc4e01c167ee063f3dcc22f51ced5b2b1e9 (patch)
treefbb32c75506c587f3506ff75b5e706f3a9784995 /io_uring/io_uring.c
parentio_uring: add a sysctl to disable io_uring system-wide (diff)
downloadlinux-45500dc4e01c167ee063f3dcc22f51ced5b2b1e9.tar.xz
linux-45500dc4e01c167ee063f3dcc22f51ced5b2b1e9.zip
io_uring: break out of iowq iopoll on teardown
io-wq will retry iopoll even when it failed with -EAGAIN. If that races with task exit, which sets TIF_NOTIFY_SIGNAL for all its workers, such workers might potentially infinitely spin retrying iopoll again and again and each time failing on some allocation / waiting / etc. Don't keep spinning if io-wq is dying. Fixes: 561fb04a6a225 ("io_uring: replace workqueue usage with io-wq") Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--io_uring/io_uring.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 0f0ba31c3850..58d8dd34a45f 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1975,6 +1975,8 @@ fail:
if (!needs_poll) {
if (!(req->ctx->flags & IORING_SETUP_IOPOLL))
break;
+ if (io_wq_worker_stopped())
+ break;
cond_resched();
continue;
}