summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-09-12 14:57:06 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-19 12:27:54 +0200
commit605d055452e7abed4aca012953aecc79c09baf12 (patch)
tree01d316e8225d0d82924fc7d23df2c837d32117e9 /io_uring/io_uring.c
parentb04f22b68643d35b3e0823ea92295b203ef83bf3 (diff)
downloadlinux-605d055452e7abed4aca012953aecc79c09baf12.tar.gz
linux-605d055452e7abed4aca012953aecc79c09baf12.tar.bz2
linux-605d055452e7abed4aca012953aecc79c09baf12.zip
io_uring: break out of iowq iopoll on teardown
[ upstream commit 45500dc4e01c167ee063f3dcc22f51ced5b2b1e9 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/io_uring.c')
-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 6d455e2428b9..7c8e81057eb1 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1823,6 +1823,8 @@ fail:
if (!needs_poll) {
if (!(req->ctx->flags & IORING_SETUP_IOPOLL))
break;
+ if (io_wq_worker_stopped())
+ break;
cond_resched();
continue;
}