mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-22 12:44:11 +08:00
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>
This commit is contained in:
parent
a1041c27b6
commit
9831a90ce6
@ -2438,7 +2438,7 @@ static int io_sq_thread(void *data)
|
|||||||
* to sleep.
|
* to sleep.
|
||||||
*/
|
*/
|
||||||
if (inflight || !time_after(jiffies, timeout)) {
|
if (inflight || !time_after(jiffies, timeout)) {
|
||||||
cpu_relax();
|
cond_resched();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user