block: Remove should_sort judgement when flush blk_plug
In commit 975927b942c932,it add blk_rq_pos to sort rq when flushing. Although this commit was used for the situation which blk_plug handled multi devices on the same time like md device. I think there must be some situations like this but only single device. So remove the should_sort judgement. Because the parameter should_sort is only for this purpose,it can delete should_sort from blk_plug. CC: Shaohua Li <shli@kernel.org> Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
242d98f077
commit
422765c263
2 changed files with 1 additions and 13 deletions
|
@ -1548,13 +1548,6 @@ void blk_queue_bio(struct request_queue *q, struct bio *bio)
|
||||||
if (list_empty(&plug->list))
|
if (list_empty(&plug->list))
|
||||||
trace_block_plug(q);
|
trace_block_plug(q);
|
||||||
else {
|
else {
|
||||||
if (!plug->should_sort) {
|
|
||||||
struct request *__rq;
|
|
||||||
|
|
||||||
__rq = list_entry_rq(plug->list.prev);
|
|
||||||
if (__rq->q != q)
|
|
||||||
plug->should_sort = 1;
|
|
||||||
}
|
|
||||||
if (request_count >= BLK_MAX_REQUEST_COUNT) {
|
if (request_count >= BLK_MAX_REQUEST_COUNT) {
|
||||||
blk_flush_plug_list(plug, false);
|
blk_flush_plug_list(plug, false);
|
||||||
trace_block_plug(q);
|
trace_block_plug(q);
|
||||||
|
@ -2888,7 +2881,6 @@ void blk_start_plug(struct blk_plug *plug)
|
||||||
plug->magic = PLUG_MAGIC;
|
plug->magic = PLUG_MAGIC;
|
||||||
INIT_LIST_HEAD(&plug->list);
|
INIT_LIST_HEAD(&plug->list);
|
||||||
INIT_LIST_HEAD(&plug->cb_list);
|
INIT_LIST_HEAD(&plug->cb_list);
|
||||||
plug->should_sort = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is a nested plug, don't actually assign it. It will be
|
* If this is a nested plug, don't actually assign it. It will be
|
||||||
|
@ -2990,10 +2982,7 @@ void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule)
|
||||||
|
|
||||||
list_splice_init(&plug->list, &list);
|
list_splice_init(&plug->list, &list);
|
||||||
|
|
||||||
if (plug->should_sort) {
|
list_sort(NULL, &list, plug_rq_cmp);
|
||||||
list_sort(NULL, &list, plug_rq_cmp);
|
|
||||||
plug->should_sort = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
q = NULL;
|
q = NULL;
|
||||||
depth = 0;
|
depth = 0;
|
||||||
|
|
|
@ -974,7 +974,6 @@ struct blk_plug {
|
||||||
unsigned long magic; /* detect uninitialized use-cases */
|
unsigned long magic; /* detect uninitialized use-cases */
|
||||||
struct list_head list; /* requests */
|
struct list_head list; /* requests */
|
||||||
struct list_head cb_list; /* md requires an unplug callback */
|
struct list_head cb_list; /* md requires an unplug callback */
|
||||||
unsigned int should_sort; /* list to be sorted before flushing? */
|
|
||||||
};
|
};
|
||||||
#define BLK_MAX_REQUEST_COUNT 16
|
#define BLK_MAX_REQUEST_COUNT 16
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue