mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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: Shaohua Li <shaohua.li@intel.com> Reviewed-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
0007a4c90a
commit
3540d5e89b
@ -1379,7 +1379,8 @@ get_rq:
|
||||
*/
|
||||
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 @@ get_rq:
|
||||
}
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user