public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring/io-wq: handle !sysctl_hung_task_timeout_secs
@ 2026-01-23 21:00 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2026-01-23 21:00 UTC (permalink / raw)
  To: io-uring

If the hung_task_timeout sysctl is set to 0, then we'll end up busy
looping inside io_wq_exit_workers() after an earlier commit switched to
using wait_for_completion_timeout(). Use the maximum schedule timeout
value for that case.

Fixes: 1f293098a313 ("io_uring/io-wq: don't trigger hung task for syzbot craziness")
Reported-by: Chris Mason <clm@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index aaf1dfc21763..3b55feb620d9 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -1340,6 +1340,8 @@ static void io_wq_exit_workers(struct io_wq *wq)
 	 * up waiting more than IO_URING_EXIT_WAIT_MAX.
 	 */
 	timeout = sysctl_hung_task_timeout_secs * HZ / 2;
+	if (!timeout)
+		timeout = MAX_SCHEDULE_TIMEOUT;
 	warn_timeout = jiffies + IO_URING_EXIT_WAIT_MAX;
 	do {
 		if (wait_for_completion_timeout(&wq->worker_done, timeout))

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-23 21:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 21:00 [PATCH] io_uring/io-wq: handle !sysctl_hung_task_timeout_secs Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox