diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-05-26 15:00:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-05-26 15:00:04 -0700 |
commit | 6fae9129b1c70bd6b7677b808c03bc96e83460fc (patch) | |
tree | 8a50f02b20d7f892e9fecd0c535104622a36d95f | |
parent | 77af1f2b9a2464e4bce20cfd32bfb2390c67de7c (diff) | |
parent | 533ab73f5b5c95dcb4152b52d5482abcc824c690 (diff) | |
download | lwn-6fae9129b1c70bd6b7677b808c03bc96e83460fc.tar.gz lwn-6fae9129b1c70bd6b7677b808c03bc96e83460fc.zip |
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
-rw-r--r-- | io_uring/sqpoll.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/io_uring/sqpoll.c b/io_uring/sqpoll.c index 9db4bc1f521a..5e329e3cd470 100644 --- a/io_uring/sqpoll.c +++ b/io_uring/sqpoll.c @@ -255,9 +255,13 @@ static int io_sq_thread(void *data) sqt_spin = true; if (sqt_spin || !time_after(jiffies, timeout)) { - cond_resched(); if (sqt_spin) timeout = jiffies + sqd->sq_thread_idle; + if (unlikely(need_resched())) { + mutex_unlock(&sqd->lock); + cond_resched(); + mutex_lock(&sqd->lock); + } continue; } |