Skip to content

Commit e167dfb

Browse files
committed
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 <[email protected]>
1 parent 74c4505 commit e167dfb

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

block/blk-mq.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,12 @@ static void blk_mq_make_request(struct request_queue *q, struct bio *bio)
11721172
goto run_queue;
11731173
}
11741174

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)) {
11761181
struct blk_mq_queue_data bd = {
11771182
.rq = rq,
11781183
.list = NULL,

include/linux/blk-mq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ enum {
146146
BLK_MQ_F_TAG_SHARED = 1 << 1,
147147
BLK_MQ_F_SG_MERGE = 1 << 2,
148148
BLK_MQ_F_SYSFS_UP = 1 << 3,
149+
BLK_MQ_F_DEFER_ISSUE = 1 << 4,
149150

150151
BLK_MQ_S_STOPPED = 0,
151152
BLK_MQ_S_TAG_ACTIVE = 1,

0 commit comments

Comments
 (0)