block: bypass ->make_request_fn for blk-mq drivers

Call blk_mq_make_request when no ->make_request_fn is set.  This is
safe now that blk_alloc_queue always sets up the pointer for make_request
based drivers.  This avoids an indirect call in the blk-mq driver I/O
fast path, which is rather expensive due to spectre mitigations.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig
2020-04-25 09:53:36 +02:00
committed by Jens Axboe
parent ae3cc8d8ff
commit 8cf7961dab
4 changed files with 24 additions and 11 deletions

View File

@@ -1788,6 +1788,9 @@ static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
int srcu_idx;
struct dm_table *map;
if (dm_get_md_type(md) == DM_TYPE_REQUEST_BASED)
return blk_mq_make_request(q, bio);
map = dm_get_live_table(md, &srcu_idx);
/* if we're suspended, we have to queue this io for later */