diff mbox series

[1/4] block/mq-deadline: pass in queue directly to dd_insert_request()

Message ID 20240119160338.1191281-2-axboe@kernel.dk (mailing list archive)
State New, archived
Headers show
Series mq-deadline scalability improvements | expand

Commit Message

Jens Axboe Jan. 19, 2024, 4:02 p.m. UTC
The hardware queue isn't relevant, deadline only operates on the queue
itself. Pass in the queue directly rather than the hardware queue, as
that more clearly explains what is being operated on.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 block/mq-deadline.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Bart Van Assche Jan. 19, 2024, 11:35 p.m. UTC | #1
On 1/19/24 08:02, Jens Axboe wrote:
> The hardware queue isn't relevant, deadline only operates on the queue
> itself. Pass in the queue directly rather than the hardware queue, as
> that more clearly explains what is being operated on.
> 
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
>   block/mq-deadline.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/block/mq-deadline.c b/block/mq-deadline.c
> index f958e79277b8..9b7563e9d638 100644
> --- a/block/mq-deadline.c
> +++ b/block/mq-deadline.c
> @@ -792,10 +792,9 @@ static bool dd_bio_merge(struct request_queue *q, struct bio *bio,
>   /*
>    * add rq to rbtree and fifo
>    */
> -static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
> +static void dd_insert_request(struct request_queue *q, struct request *rq,
>   			      blk_insert_t flags, struct list_head *free)
>   {
> -	struct request_queue *q = hctx->queue;
>   	struct deadline_data *dd = q->elevator->elevator_data;
>   	const enum dd_data_dir data_dir = rq_data_dir(rq);
>   	u16 ioprio = req_get_ioprio(rq);
> @@ -875,7 +874,7 @@ static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
>   
>   		rq = list_first_entry(list, struct request, queuelist);
>   		list_del_init(&rq->queuelist);
> -		dd_insert_request(hctx, rq, flags, &free);
> +		dd_insert_request(q, rq, flags, &free);
>   	}
>   	spin_unlock(&dd->lock);

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
diff mbox series

Patch

diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index f958e79277b8..9b7563e9d638 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -792,10 +792,9 @@  static bool dd_bio_merge(struct request_queue *q, struct bio *bio,
 /*
  * add rq to rbtree and fifo
  */
-static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
+static void dd_insert_request(struct request_queue *q, struct request *rq,
 			      blk_insert_t flags, struct list_head *free)
 {
-	struct request_queue *q = hctx->queue;
 	struct deadline_data *dd = q->elevator->elevator_data;
 	const enum dd_data_dir data_dir = rq_data_dir(rq);
 	u16 ioprio = req_get_ioprio(rq);
@@ -875,7 +874,7 @@  static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
 
 		rq = list_first_entry(list, struct request, queuelist);
 		list_del_init(&rq->queuelist);
-		dd_insert_request(hctx, rq, flags, &free);
+		dd_insert_request(q, rq, flags, &free);
 	}
 	spin_unlock(&dd->lock);