Skip to content

Commit 3bee991

Browse files
Zhaoyang Huangaxboe
authored andcommitted
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>
1 parent 1ebd4a3 commit 3bee991

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/loop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,8 @@ static void loop_queue_work(struct loop_device *lo, struct loop_cmd *cmd)
894894
cmd_list = &lo->rootcg_cmd_list;
895895
}
896896
list_add_tail(&cmd->list_entry, cmd_list);
897-
queue_work(lo->workqueue, work);
898897
spin_unlock_irq(&lo->lo_work_lock);
898+
queue_work(lo->workqueue, work);
899899
}
900900

901901
static void loop_set_timer(struct loop_device *lo)

0 commit comments

Comments
 (0)