@@ -1255,7 +1255,7 @@ static void bfq_add_to_burst(struct bfq_data *bfqd, struct bfq_queue *bfqq)
bfqd->burst_size++;
if (bfqd->burst_size == bfqd->bfq_large_burst_thresh) {
- struct bfq_queue *pos, *bfqq_item;
+ struct bfq_queue *pos;
struct hlist_node *n;
/*
@@ -1267,13 +1267,6 @@ static void bfq_add_to_burst(struct bfq_data *bfqd, struct bfq_queue *bfqq)
/*
* We can now mark all queues in the burst list as
* belonging to a large burst.
- */
- hlist_for_each_entry(bfqq_item, &bfqd->burst_list,
- burst_list_node)
- bfq_mark_bfqq_in_large_burst(bfqq_item);
- bfq_mark_bfqq_in_large_burst(bfqq);
-
- /*
* From now on, and until the current burst finishes, any
* new queue being activated shortly after the last queue
* was inserted in the burst can be immediately marked as
@@ -1281,8 +1274,11 @@ static void bfq_add_to_burst(struct bfq_data *bfqd, struct bfq_queue *bfqq)
* needed any more. Remove it.
*/
hlist_for_each_entry_safe(pos, n, &bfqd->burst_list,
- burst_list_node)
+ burst_list_node) {
+ bfq_mark_bfqq_in_large_burst(pos);
hlist_del_init(&pos->burst_list_node);
+ }
+ bfq_mark_bfqq_in_large_burst(bfqq);
} else /*
* Burst not yet large: add bfqq to the burst list. Do
* not increment the ref counter for bfqq, because bfqq
Do mark burst and remove from list in a single traverse to remove unnecessary re-traverse. Signed-off-by: Kemeng Shi <shikemeng@huawei.com> --- block/bfq-iosched.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)