block: move elevator queue allocation logic into blk_mq_init_sched
authorNilay Shroff <nilay@linux.ibm.com>
Wed, 30 Jul 2025 07:46:07 +0000 (13:16 +0530)
committerJens Axboe <axboe@kernel.dk>
Wed, 30 Jul 2025 12:20:51 +0000 (06:20 -0600)
commit49811586be373e26a3ab52f54e0dfa663c02fddd
treea6d88add0ff7bc1a9cfa3184856cf553fd8b2d7b
parent5421681bc3ef13476bd9443379cd69381e8760fa
block: move elevator queue allocation logic into blk_mq_init_sched

In preparation for allocating sched_tags before freezing the request
queue and acquiring ->elevator_lock, move the elevator queue allocation
logic from the elevator ops ->init_sched callback into blk_mq_init_sched.
As elevator_alloc is now only invoked from block layer core, we don't
need to export it, so unexport elevator_alloc function.

This refactoring provides a centralized location for elevator queue
initialization, which makes it easier to store pre-allocated sched_tags
in the struct elevator_queue during later changes.

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
Link: https://lore.kernel.org/r/20250730074614.2537382-2-nilay@linux.ibm.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-iosched.c
block/blk-mq-sched.c
block/elevator.c
block/elevator.h
block/kyber-iosched.c
block/mq-deadline.c