File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2135,6 +2135,18 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
2135
2135
}
2136
2136
}
2137
2137
2138
+ /*
2139
+ * Allow 4x BLK_MAX_REQUEST_COUNT requests on plug queue for multiple
2140
+ * queues. This is important for md arrays to benefit from merging
2141
+ * requests.
2142
+ */
2143
+ static inline unsigned short blk_plug_max_rq_count (struct blk_plug * plug )
2144
+ {
2145
+ if (plug -> multiple_queues )
2146
+ return BLK_MAX_REQUEST_COUNT * 4 ;
2147
+ return BLK_MAX_REQUEST_COUNT ;
2148
+ }
2149
+
2138
2150
/**
2139
2151
* blk_mq_submit_bio - Create and send a request to block device.
2140
2152
* @bio: Bio pointer.
@@ -2231,7 +2243,7 @@ blk_qc_t blk_mq_submit_bio(struct bio *bio)
2231
2243
else
2232
2244
last = list_entry_rq (plug -> mq_list .prev );
2233
2245
2234
- if (request_count >= BLK_MAX_REQUEST_COUNT || (last &&
2246
+ if (request_count >= blk_plug_max_rq_count ( plug ) || (last &&
2235
2247
blk_rq_bytes (last ) >= BLK_PLUG_FLUSH_SIZE )) {
2236
2248
blk_flush_plug_list (plug , false);
2237
2249
trace_block_plug (q );
You can’t perform that action at this time.
0 commit comments