aboutsummaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-09-19 09:48:55 -0600
committerJens Axboe <axboe@kernel.dk>2019-09-19 09:49:26 -0600
commit9831a90ce64362f8429e8fd23838a9db2cdf7803 (patch)
tree3a5155b8748a40c289426b56b04d36fe8b0b379d /fs/io_uring.c
parentio_uring: fix potential crash issue due to io_get_req failure (diff)
downloadlinux-dev-9831a90ce64362f8429e8fd23838a9db2cdf7803.tar.xz
linux-dev-9831a90ce64362f8429e8fd23838a9db2cdf7803.zip
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 <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 854dedd885fa..05a299e80159 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;
}