diff options
author | Jens Axboe | 2021-10-13 08:28:14 -0600 |
---|---|---|
committer | Jens Axboe | 2021-10-19 15:18:25 -0600 |
commit | a808a9d545cdffb964f27239d1fc0c6e2330b424 (patch) | |
tree | 4157216f874fa4385bc09f2ac1500cebee9a2ab0 /block/blk-mq.c | |
parent | d92ca9d8348fb12c89eac5928bd651c3a485d7b9 (diff) |
block: inline fast path of driver tag allocation
If we don't use an IO scheduler or have shared tags, then we don't need
to call into this external function at all. This saves ~2% for such
a setup.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 3481a8712234..bf5936d72de8 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1324,7 +1324,7 @@ struct request *blk_mq_dequeue_from_ctx(struct blk_mq_hw_ctx *hctx, return data.rq; } -static bool __blk_mq_get_driver_tag(struct request *rq) +static bool __blk_mq_alloc_driver_tag(struct request *rq) { struct sbitmap_queue *bt = &rq->mq_hctx->tags->bitmap_tags; unsigned int tag_offset = rq->mq_hctx->tags->nr_reserved_tags; @@ -1348,11 +1348,9 @@ static bool __blk_mq_get_driver_tag(struct request *rq) return true; } -bool blk_mq_get_driver_tag(struct request *rq) +bool __blk_mq_get_driver_tag(struct blk_mq_hw_ctx *hctx, struct request *rq) { - struct blk_mq_hw_ctx *hctx = rq->mq_hctx; - - if (rq->tag == BLK_MQ_NO_TAG && !__blk_mq_get_driver_tag(rq)) + if (rq->tag == BLK_MQ_NO_TAG && !__blk_mq_alloc_driver_tag(rq)) return false; if ((hctx->flags & BLK_MQ_F_TAG_QUEUE_SHARED) && |