|
@@ -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);
|
|
|
}
|