There have been few reports suggesting potential lockdep caused due to the percpu lock dependency on elevator lock. This patchset aims to fix that dependency. This patchset contains the two patches. The first patch is preparatory patch and just move elevator queue allocation logic from ->init_sched into blk_mq_init_sched. The second patch in the series restructure the sched tags management code so that sched tags allocation and de-allocation now occurs entirely outside of the ->freeze_lock and ->elevator_lock, eliminating the percpu lock dependency on elevator lock problem which could potentially occur during scheduler updates or hardware queue updates. Change since v2: - Split the patch into a two patch series. The first patch updates ->init_sched elevator API change and second patch handles the sched tags allocation/de-allocation logic (Ming Lei) - Address sched tags allocation/deallocation logic while running in the context of nr_hw_queue update so that we can handle all posible scenarios in a single patchest (Ming Lei) Link to v2: https://lore.kernel.org/all/20250528123638.1029700-1-nilay@xxxxxxxxxxxxx/ Changes since v1: - As the lifetime of elevator queue and sched tags are same, allocate and move sched tags under struct elevator_queue (Ming Lei) Link to v1: https://lore.kernel.org/all/20250520103425.1259712-1-nilay@xxxxxxxxxxxxx/ Nilay Shroff (2): block: move elevator queue allocation logic into blk_mq_init_sched block: fix lock dependency between percpu alloc lock and elevator lock block/bfq-iosched.c | 13 +-- block/blk-mq-sched.c | 247 +++++++++++++++++++++++++++++++----------- block/blk-mq-sched.h | 13 ++- block/blk-mq.c | 14 ++- block/blk.h | 4 +- block/elevator.c | 82 ++++++++++---- block/elevator.h | 30 ++++- block/kyber-iosched.c | 11 +- block/mq-deadline.c | 14 +-- 9 files changed, 308 insertions(+), 120 deletions(-) -- 2.49.0