Skip to content
Commit 533ab73f authored by Wenwen Chen's avatar Wenwen Chen Committed by Jens Axboe
Browse files

io_uring: unlock sqd->lock before sq thread release CPU



The sq thread actively releases CPU resources by calling the
cond_resched() and schedule() interfaces when it is idle. Therefore,
more resources are available for other threads to run.

There exists a problem in sq thread: it does not unlock sqd->lock before
releasing CPU resources every time. This makes other threads pending on
sqd->lock for a long time. For example, the following interfaces all
require sqd->lock: io_sq_offload_create(), io_register_iowq_max_workers()
and io_ring_exit_work().

Before the sq thread releases CPU resources, unlocking sqd->lock will
provide the user a better experience because it can respond quickly to
user requests.

Signed-off-by: default avatarKanchan <Joshi&lt;joshi.k@samsung.com>
Signed-off-by: default avatarWenwen <Chen&lt;wenwen.chen@samsung.com>
Link: https://lore.kernel.org/r/20230525082626.577862-1-wenwen.chen@samsung.com
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 293007b0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment