Skip to content

Commit e78a442

Browse files
Chengkaitaokawasaki
authored andcommitted
block/mq-deadline: Remove redundant hctx pointer dereferencing operation
The value of 'hctx->queue' is already stored in '*q' within dd_insert_requests, we can directly reuse the result instead of dereferencing hctx again in the dd_insert_request function. This patch removes the redundant operation and modifies the function's parameters accordingly. We can eliminate an LDR instruction. Signed-off-by: Chengkaitao <[email protected]>
1 parent 4458758 commit e78a442

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

block/mq-deadline.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,9 @@ static bool dd_bio_merge(struct request_queue *q, struct bio *bio,
633633
/*
634634
* add rq to rbtree and fifo
635635
*/
636-
static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
636+
static void dd_insert_request(struct request_queue *q, struct request *rq,
637637
blk_insert_t flags, struct list_head *free)
638638
{
639-
struct request_queue *q = hctx->queue;
640639
struct deadline_data *dd = q->elevator->elevator_data;
641640
const enum dd_data_dir data_dir = rq_data_dir(rq);
642641
u16 ioprio = req_get_ioprio(rq);
@@ -694,7 +693,7 @@ static void dd_insert_requests(struct blk_mq_hw_ctx *hctx,
694693

695694
rq = list_first_entry(list, struct request, queuelist);
696695
list_del_init(&rq->queuelist);
697-
dd_insert_request(hctx, rq, flags, &free);
696+
dd_insert_request(q, rq, flags, &free);
698697
}
699698
spin_unlock(&dd->lock);
700699

0 commit comments

Comments
 (0)