diff options
author | Jens Axboe <axboe@fb.com> | 2014-10-29 13:18:26 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-10-29 13:18:26 -0400 |
commit | e167dfb53cb85fde7b15f644e9dbef7ba31896b6 (patch) | |
tree | baf22faa1d3de6c2a70faeacc0599f01f5469a2d | |
parent | 74c450521dd8d245b982da62592a18aa6f88b045 (diff) |
blk-mq: add BLK_MQ_F_DEFER_ISSUE support flag
Drivers can now tell blk-mq if they take advantage of the deferred
issue through 'last' or not. If they do, don't do queue-direct
for sync IO. This is a preparation patch for the nvme conversion.
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | block/blk-mq.c | 7 | ||||
-rw-r--r-- | include/linux/blk-mq.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 7e5303820452..b355b5957cd7 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -1172,7 +1172,12 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio) | |||
1172 | goto run_queue; | 1172 | goto run_queue; |
1173 | } | 1173 | } |
1174 | 1174 | ||
1175 | if (is_sync) { | 1175 | /* |
1176 | * If the driver supports defer issued based on 'last', then | ||
1177 | * queue it up like normal since we can potentially save some | ||
1178 | * CPU this way. | ||
1179 | */ | ||
1180 | if (is_sync && !(data.hctx->flags & BLK_MQ_F_DEFER_ISSUE)) { | ||
1176 | struct blk_mq_queue_data bd = { | 1181 | struct blk_mq_queue_data bd = { |
1177 | .rq = rq, | 1182 | .rq = rq, |
1178 | .list = NULL, | 1183 | .list = NULL, |
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index be01d7a687d4..c3b64ec5321e 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
@@ -146,6 +146,7 @@ enum { | |||
146 | BLK_MQ_F_TAG_SHARED = 1 << 1, | 146 | BLK_MQ_F_TAG_SHARED = 1 << 1, |
147 | BLK_MQ_F_SG_MERGE = 1 << 2, | 147 | BLK_MQ_F_SG_MERGE = 1 << 2, |
148 | BLK_MQ_F_SYSFS_UP = 1 << 3, | 148 | BLK_MQ_F_SYSFS_UP = 1 << 3, |
149 | BLK_MQ_F_DEFER_ISSUE = 1 << 4, | ||
149 | 150 | ||
150 | BLK_MQ_S_STOPPED = 0, | 151 | BLK_MQ_S_STOPPED = 0, |
151 | BLK_MQ_S_TAG_ACTIVE = 1, | 152 | BLK_MQ_S_TAG_ACTIVE = 1, |