summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2016-11-03 17:03:54 -0700
committerHuang, Tao <huangtao@rock-chips.com>2017-09-15 09:39:41 +0800
commit331eee6d7ee99b8869ccd6f7f2e47edb07b35d55 (patch)
tree5f05be319a0a451318f6d8e7667c140e9fbd084c /block
parent63e2f4ea2deeef82179d5a3bff76347b2ed738fb (diff)
UPSTREAM: 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. Change-Id: I2bf7fe5749d66e0192c08d16c4bb8d057ad8833f Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com> (cherry pick from 600271d9000027c013c01be87cbb90a5a18c5c3f)
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 0d1af3e44efb..aaea6ea66fac 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1377,13 +1377,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);
}