Skip to content

Commit 8160958

Browse files
committed
io_uring/io-wq: handle !sysctl_hung_task_timeout_secs
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: 1f29309 ("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>
1 parent 1edf089 commit 8160958

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

io_uring/io-wq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,8 @@ static void io_wq_exit_workers(struct io_wq *wq)
13401340
* up waiting more than IO_URING_EXIT_WAIT_MAX.
13411341
*/
13421342
timeout = sysctl_hung_task_timeout_secs * HZ / 2;
1343+
if (!timeout)
1344+
timeout = MAX_SCHEDULE_TIMEOUT;
13431345
warn_timeout = jiffies + IO_URING_EXIT_WAIT_MAX;
13441346
do {
13451347
if (wait_for_completion_timeout(&wq->worker_done, timeout))

0 commit comments

Comments
 (0)