Skip to content

Commit

Permalink
io_uring: use cond_resched() in sqthread
Browse files Browse the repository at this point in the history
If preempt isn't enabled in the kernel, we can run into hang issues with
sqthread submissions. Use cond_resched() to play nice instead of
cpu_relax(), if we end up starting the loop and not having any events
pending for submissions.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
axboe committed Sep 19, 2019
1 parent a1041c2 commit 9831a90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@ static int io_sq_thread(void *data)
* to sleep.
*/
if (inflight || !time_after(jiffies, timeout)) {
cpu_relax();
cond_resched();
continue;
}

Expand Down

0 comments on commit 9831a90

Please sign in to comment.