Skip to content

Commit

Permalink
block: don't verify IO lock for freeze/unfreeze in elevator_init_mq()
Browse files Browse the repository at this point in the history
commit 357e1b7 upstream.

elevator_init_mq() is only called at the entry of add_disk_fwnode() when
disk IO isn't allowed yet.

So not verify io lock(q->io_lockdep_map) for freeze & unfreeze in
elevator_init_mq().

Reported-by: Marek Szyprowski <[email protected]>
Reported-by: Lai Yi <[email protected]>
Fixes: f1be178 ("block: model freeze & enter queue as lock for supporting lockdep")
Signed-off-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Ming Lei authored and gregkh committed Dec 5, 2024
1 parent b12cfca commit 6cea478
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,19 @@ void elevator_init_mq(struct request_queue *q)
* drain any dispatch activities originated from passthrough
* requests, then no need to quiesce queue which may add long boot
* latency, especially when lots of disks are involved.
*
* Disk isn't added yet, so verifying queue lock only manually.
*/
blk_mq_freeze_queue(q);
blk_freeze_queue_start_non_owner(q);
blk_freeze_acquire_lock(q, true, false);
blk_mq_freeze_queue_wait(q);

blk_mq_cancel_work_sync(q);

err = blk_mq_init_sched(q, e);

blk_mq_unfreeze_queue(q);
blk_unfreeze_release_lock(q, true, false);
blk_mq_unfreeze_queue_non_owner(q);

if (err) {
pr_warn("\"%s\" elevator initialization failed, "
Expand Down

0 comments on commit 6cea478

Please sign in to comment.