loop: release the lo_work_lock before queue_work
authorZhaoyang Huang <zhaoyang.huang@unisoc.com>
Fri, 7 Feb 2025 09:19:42 +0000 (17:19 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Feb 2025 14:14:28 +0000 (07:14 -0700)
commit3bee991f2b68175c828dc3f9c26367fe1827319a
tree075f0744811a49582ba96c5749d727ff73efb35d
parent1ebd4a3c095cd538d3c1c7c12738ef47d8e71f96
loop: release the lo_work_lock before queue_work

queue_work could spin on wq->cpu_pwq->pool->lock which could lead to
concurrent loop_process_work failed on lo_work_lock contention and
increase the request latency. Remove this combination by moving the
lock release ahead of queue_work.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Link: https://lore.kernel.org/r/20250207091942.3966756-1-zhaoyang.huang@unisoc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c