From: Jens Axboe Date: Thu, 19 Sep 2019 15:48:55 +0000 (-0600) Subject: io_uring: use cond_resched() in sqthread X-Git-Tag: v5.4-rc1~53^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9831a90ce64362f8429e8fd23838a9db2cdf7803;p=thirdparty%2Fkernel%2Flinux.git io_uring: use cond_resched() in sqthread 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 --- diff --git a/fs/io_uring.c b/fs/io_uring.c index 854dedd885fa8..05a299e80159b 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2438,7 +2438,7 @@ static int io_sq_thread(void *data) * to sleep. */ if (inflight || !time_after(jiffies, timeout)) { - cpu_relax(); + cond_resched(); continue; }