Re: [PATCHv6 1/3] block: move elevator queue allocation logic into blk_mq_init_sched

Hannes Reinecke
2025-06-30T06:17:43Z

On 6/30/25 07:21, Nilay Shroff wrote:
> 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>
> Signed-off-by: Nilay Shroff <nilay@linux.ibm.com>
> ---
> block/bfq-iosched.c | 13 +++----------
> block/blk-mq-sched.c | 11 ++++++++---
> block/elevator.c | 1 -
> block/elevator.h | 2 +-
> block/kyber-iosched.c | 11 ++---------
> block/mq-deadline.c | 14 ++------------
> 6 files changed, 16 insertions(+), 36 deletions(-)
>
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich