Commit 3d924fc
Ming Lei
block: move elv_register[unregister]_queue out of elevator_lock
JIRA: https://issues.redhat.com/browse/RHEL-106845
commit 559dc11
Author: Ming Lei <ming.lei@redhat.com>
Date: Mon May 5 22:17:59 2025 +0800
block: move elv_register[unregister]_queue out of elevator_lock
Move elv_register[unregister]_queue out of ->elevator_lock & queue freezing,
so we can kill many lockdep warnings.
elv_register[unregister]_queue() is serialized, and just dealing with sysfs/
debugfs things, no need to be done with queue frozen:
- when it is called from adding disk, elevator switch isn't possible
because ->queue_kobj isn't added yet
- when it is called from deleting disk, disable_elv_switch() is
responsible for preventing new elevator switch and draining old
elevator switch.
- when it is called from blk_mq_update_nr_hw_queues(), adding/removing
disk and elevator switch can't be allowed or in-progress
With this change, elevator's ->exit() is called before calling
elv_unregister_queue, then user may call into ->show()/store() of elevator's
sysfs attributes, and we have covered this issue by adding `ELEVATOR_FLAG_DYNG`.
For blk-mq debugfs, hctx->sched_tags is always checked with ->elevator_lock by
debugfs code, meantime hctx->sched_tags is updated with ->elevator_lock, so
there isn't such issue.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250505141805.2751237-22-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ming Lei <ming.lei@redhat.com>1 parent 0a954cf commit 3d924fc
2 files changed
+53
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5041 | 5041 | | |
5042 | 5042 | | |
5043 | 5043 | | |
| 5044 | + | |
5044 | 5045 | | |
5045 | 5046 | | |
5046 | 5047 | | |
5047 | | - | |
5048 | | - | |
5049 | 5048 | | |
5050 | 5049 | | |
5051 | 5050 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
| 166 | + | |
| 167 | + | |
161 | 168 | | |
162 | 169 | | |
163 | 170 | | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
167 | | - | |
168 | | - | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
| |||
466 | 471 | | |
467 | 472 | | |
468 | 473 | | |
469 | | - | |
470 | | - | |
471 | 474 | | |
472 | 475 | | |
473 | 476 | | |
| |||
494 | 497 | | |
495 | 498 | | |
496 | 499 | | |
497 | | - | |
498 | | - | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
| |||
586 | 587 | | |
587 | 588 | | |
588 | 589 | | |
589 | | - | |
| 590 | + | |
590 | 591 | | |
591 | 592 | | |
592 | 593 | | |
593 | 594 | | |
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
601 | | - | |
| 598 | + | |
602 | 599 | | |
603 | 600 | | |
604 | 601 | | |
| |||
619 | 616 | | |
620 | 617 | | |
621 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
622 | 651 | | |
623 | 652 | | |
624 | 653 | | |
| |||
645 | 674 | | |
646 | 675 | | |
647 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
648 | 680 | | |
649 | 681 | | |
650 | 682 | | |
| |||
654 | 686 | | |
655 | 687 | | |
656 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
657 | 692 | | |
658 | 693 | | |
659 | 694 | | |
660 | 695 | | |
661 | | - | |
662 | | - | |
663 | | - | |
| 696 | + | |
664 | 697 | | |
665 | 698 | | |
666 | | - | |
| 699 | + | |
667 | 700 | | |
668 | 701 | | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
669 | 705 | | |
670 | 706 | | |
671 | 707 | | |
| |||
0 commit comments