summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-04-25 10:53:36 +0300
committerJens Axboe <axboe@kernel.dk>2020-04-25 18:45:44 +0300
commit8cf7961dab42c9177a556b719c15f5b9449c24d1 (patch)
treecf0e7e5d0b7f6f0ee665629b61fc91cc56ed77c7 /drivers/md
parentae3cc8d8ff061d3ffca96665685550e70a86472a (diff)
downloadlinux-8cf7961dab42c9177a556b719c15f5b9449c24d1.tar.xz
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index db9e46114653..0eb93da44ea2 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -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 */