summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhaoyang Huang <zhaoyang.huang@unisoc.com>2025-02-07 17:19:42 +0800
committerJens Axboe <axboe@kernel.dk>2025-02-11 07:14:28 -0700
commit3bee991f2b68175c828dc3f9c26367fe1827319a (patch)
tree075f0744811a49582ba96c5749d727ff73efb35d
parent1ebd4a3c095cd538d3c1c7c12738ef47d8e71f96 (diff)
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>
-rw-r--r--drivers/block/loop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index c05fe27a96b6..68c943a77e41 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -894,8 +894,8 @@ queue_work:
cmd_list = &lo->rootcg_cmd_list;
}
list_add_tail(&cmd->list_entry, cmd_list);
- queue_work(lo->workqueue, work);
spin_unlock_irq(&lo->lo_work_lock);
+ queue_work(lo->workqueue, work);
}
static void loop_set_timer(struct loop_device *lo)