summaryrefslogtreecommitdiff
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorLin Feng <linf@wangsu.com>2021-04-15 06:39:20 +0300
committerJens Axboe <axboe@kernel.dk>2021-04-16 15:06:49 +0300
commit8d663f34f8afcf5fc6a84c3cc4fa28cc84d58e39 (patch)
treee2e2bfc66c32ed36a7a2f8f376f6e60da8909a75 /include/linux/blkdev.h
parent347b546d5a9bd5871279a29be3dce8b5aad47ef6 (diff)
downloadlinux-8d663f34f8afcf5fc6a84c3cc4fa28cc84d58e39.tar.xz
blk-mq: bypass IO scheduler's limit_depth for passthrough request
Commit 01e99aeca39796003 ("blk-mq: insert passthrough request into hctx->dispatch directly") gives high priority to passthrough requests and bypass underlying IO scheduler. But as we allocate tag for such request it still runs io-scheduler's callback limit_depth, while we really want is to give full sbitmap-depth capabity to such request for acquiring available tag. blktrace shows PC requests(dmraid -s -c -i) hit bfq's limit_depth: 8,0 2 0 0.000000000 39952 1,0 m N bfq [bfq_limit_depth] wr_busy 0 sync 0 depth 8 8,0 2 1 0.000008134 39952 D R 4 [dmraid] 8,0 2 2 0.000021538 24 C R [0] 8,0 2 0 0.000035442 39952 1,0 m N bfq [bfq_limit_depth] wr_busy 0 sync 0 depth 8 8,0 2 3 0.000038813 39952 D R 24 [dmraid] 8,0 2 4 0.000044356 24 C R [0] This patch introduce a new wrapper to make code not that ugly. Signed-off-by: Lin Feng <linf@wangsu.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20210415033920.213963-1-linf@wangsu.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 30d2090583ad..f2e77ba97550 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -274,6 +274,12 @@ static inline bool bio_is_passthrough(struct bio *bio)
return blk_op_is_scsi(op) || blk_op_is_private(op);
}
+static inline bool blk_op_is_passthrough(unsigned int op)
+{
+ return (blk_op_is_scsi(op & REQ_OP_MASK) ||
+ blk_op_is_private(op & REQ_OP_MASK));
+}
+
static inline unsigned short req_get_ioprio(struct request *req)
{
return req->ioprio;