Skip to content

Commit 4ec5c05

Browse files
Christoph Hellwigaxboe
authored andcommitted
blk-mq: fold __blk_mq_insert_req_list into blk_mq_insert_request
Remove this very small helper and fold it into the only caller. Note that this moves the trace_block_rq_insert out of ctx->lock, matching the other calls to this tracepoint. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Link: https://lore.kernel.org/r/20230413064057.707578-9-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent a88db1e commit 4ec5c05

1 file changed

Lines changed: 7 additions & 18 deletions

File tree

block/blk-mq.c

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,23 +2446,6 @@ static void blk_mq_run_work_fn(struct work_struct *work)
24462446
__blk_mq_run_hw_queue(hctx);
24472447
}
24482448

2449-
static inline void __blk_mq_insert_req_list(struct blk_mq_hw_ctx *hctx,
2450-
struct request *rq,
2451-
bool at_head)
2452-
{
2453-
struct blk_mq_ctx *ctx = rq->mq_ctx;
2454-
enum hctx_type type = hctx->type;
2455-
2456-
lockdep_assert_held(&ctx->lock);
2457-
2458-
trace_block_rq_insert(rq);
2459-
2460-
if (at_head)
2461-
list_add(&rq->queuelist, &ctx->rq_lists[type]);
2462-
else
2463-
list_add_tail(&rq->queuelist, &ctx->rq_lists[type]);
2464-
}
2465-
24662449
/**
24672450
* blk_mq_request_bypass_insert - Insert a request at dispatch list.
24682451
* @rq: Pointer to request to be inserted.
@@ -2586,8 +2569,14 @@ static void blk_mq_insert_request(struct request *rq, bool at_head,
25862569
list_add(&rq->queuelist, &list);
25872570
e->type->ops.insert_requests(hctx, &list, at_head);
25882571
} else {
2572+
trace_block_rq_insert(rq);
2573+
25892574
spin_lock(&ctx->lock);
2590-
__blk_mq_insert_req_list(hctx, rq, at_head);
2575+
if (at_head)
2576+
list_add(&rq->queuelist, &ctx->rq_lists[hctx->type]);
2577+
else
2578+
list_add_tail(&rq->queuelist,
2579+
&ctx->rq_lists[hctx->type]);
25912580
blk_mq_hctx_mark_pending(hctx, ctx);
25922581
spin_unlock(&ctx->lock);
25932582
}

0 commit comments

Comments
 (0)