Skip to content

Commit 6fae912

Browse files
committed
Merge tag 'io_uring-6.4-2023-05-26' of git://git.kernel.dk/linux
Pull io_uring fix from Jens Axboe: "Just a single fix for the conditional schedule with the SQPOLL thread, dropping the uring_lock if we do need to reschedule" * tag 'io_uring-6.4-2023-05-26' of git://git.kernel.dk/linux: io_uring: unlock sqd->lock before sq thread release CPU
2 parents 77af1f2 + 533ab73 commit 6fae912

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

io_uring/sqpoll.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,13 @@ static int io_sq_thread(void *data)
255255
sqt_spin = true;
256256

257257
if (sqt_spin || !time_after(jiffies, timeout)) {
258-
cond_resched();
259258
if (sqt_spin)
260259
timeout = jiffies + sqd->sq_thread_idle;
260+
if (unlikely(need_resched())) {
261+
mutex_unlock(&sqd->lock);
262+
cond_resched();
263+
mutex_lock(&sqd->lock);
264+
}
261265
continue;
262266
}
263267

0 commit comments

Comments
 (0)