diff options
author | Shaohua Li <shli@fb.com> | 2016-11-04 01:03:54 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-04 05:00:38 +0100 |
commit | 600271d9000027c013c01be87cbb90a5a18c5c3f (patch) | |
tree | ba168ba501b07854f0a0c9dea6c52810d2212da8 /block | |
parent | block: immediately dispatch big size request (diff) | |
download | linux-600271d9000027c013c01be87cbb90a5a18c5c3f.tar.xz linux-600271d9000027c013c01be87cbb90a5a18c5c3f.zip |
blk-mq: immediately dispatch big size request
This is corresponding part for blk-mq. Disk with multiple hardware
queues doesn't need this as we only hold 1 request at most.
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 8d3de5bd4d6f..077c2416a955 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1453,13 +1453,18 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) */ plug = current->plug; if (plug) { + struct request *last = NULL; + blk_mq_bio_to_request(rq, bio); if (!request_count) trace_block_plug(q); + else + last = list_entry_rq(plug->mq_list.prev); blk_mq_put_ctx(data.ctx); - if (request_count >= BLK_MAX_REQUEST_COUNT) { + if (request_count >= BLK_MAX_REQUEST_COUNT || (last && + blk_rq_bytes(last) >= BLK_PLUG_FLUSH_SIZE)) { blk_flush_plug_list(plug, false); trace_block_plug(q); } |