提交 3540d5e8 编写于 作者: S Shaohua Li 提交者: Jens Axboe

block: avoid unnecessary plug list flush

get_request_wait() could sleep and flush the plug list.  If the list is
already flushed, don't flush again.
Signed-off-by: NShaohua Li <shaohua.li@intel.com>
Reviewed-by: NNamhyung Kim <namhyung@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 0007a4c9
......@@ -1379,7 +1379,8 @@ void blk_queue_bio(struct request_queue *q, struct bio *bio)
*/
if (list_empty(&plug->list))
trace_block_plug(q);
else if (!plug->should_sort) {
else {
if (!plug->should_sort) {
struct request *__rq;
__rq = list_entry_rq(plug->list.prev);
......@@ -1388,6 +1389,7 @@ void blk_queue_bio(struct request_queue *q, struct bio *bio)
}
if (request_count >= BLK_MAX_REQUEST_COUNT)
blk_flush_plug_list(plug, false);
}
list_add_tail(&req->queuelist, &plug->list);
drive_stat_acct(req, 1);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册