diff options
-rw-r--r-- | block/bfq-iosched.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 33b63bc4a64b..115747fe43c8 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c | |||
@@ -2061,10 +2061,27 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq) | |||
2061 | bic->saved_IO_bound = bfq_bfqq_IO_bound(bfqq); | 2061 | bic->saved_IO_bound = bfq_bfqq_IO_bound(bfqq); |
2062 | bic->saved_in_large_burst = bfq_bfqq_in_large_burst(bfqq); | 2062 | bic->saved_in_large_burst = bfq_bfqq_in_large_burst(bfqq); |
2063 | bic->was_in_burst_list = !hlist_unhashed(&bfqq->burst_list_node); | 2063 | bic->was_in_burst_list = !hlist_unhashed(&bfqq->burst_list_node); |
2064 | bic->saved_wr_coeff = bfqq->wr_coeff; | 2064 | if (unlikely(bfq_bfqq_just_created(bfqq) && |
2065 | bic->saved_wr_start_at_switch_to_srt = bfqq->wr_start_at_switch_to_srt; | 2065 | !bfq_bfqq_in_large_burst(bfqq))) { |
2066 | bic->saved_last_wr_start_finish = bfqq->last_wr_start_finish; | 2066 | /* |
2067 | bic->saved_wr_cur_max_time = bfqq->wr_cur_max_time; | 2067 | * bfqq being merged right after being created: bfqq |
2068 | * would have deserved interactive weight raising, but | ||
2069 | * did not make it to be set in a weight-raised state, | ||
2070 | * because of this early merge. Store directly the | ||
2071 | * weight-raising state that would have been assigned | ||
2072 | * to bfqq, so that to avoid that bfqq unjustly fails | ||
2073 | * to enjoy weight raising if split soon. | ||
2074 | */ | ||
2075 | bic->saved_wr_coeff = bfqq->bfqd->bfq_wr_coeff; | ||
2076 | bic->saved_wr_cur_max_time = bfq_wr_duration(bfqq->bfqd); | ||
2077 | bic->saved_last_wr_start_finish = jiffies; | ||
2078 | } else { | ||
2079 | bic->saved_wr_coeff = bfqq->wr_coeff; | ||
2080 | bic->saved_wr_start_at_switch_to_srt = | ||
2081 | bfqq->wr_start_at_switch_to_srt; | ||
2082 | bic->saved_last_wr_start_finish = bfqq->last_wr_start_finish; | ||
2083 | bic->saved_wr_cur_max_time = bfqq->wr_cur_max_time; | ||
2084 | } | ||
2068 | } | 2085 | } |
2069 | 2086 | ||
2070 | static void | 2087 | static void |
@@ -4150,7 +4167,6 @@ static void __bfq_insert_request(struct bfq_data *bfqd, struct request *rq) | |||
4150 | new_bfqq->allocated++; | 4167 | new_bfqq->allocated++; |
4151 | bfqq->allocated--; | 4168 | bfqq->allocated--; |
4152 | new_bfqq->ref++; | 4169 | new_bfqq->ref++; |
4153 | bfq_clear_bfqq_just_created(bfqq); | ||
4154 | /* | 4170 | /* |
4155 | * If the bic associated with the process | 4171 | * If the bic associated with the process |
4156 | * issuing this request still points to bfqq | 4172 | * issuing this request still points to bfqq |
@@ -4162,6 +4178,8 @@ static void __bfq_insert_request(struct bfq_data *bfqd, struct request *rq) | |||
4162 | if (bic_to_bfqq(RQ_BIC(rq), 1) == bfqq) | 4178 | if (bic_to_bfqq(RQ_BIC(rq), 1) == bfqq) |
4163 | bfq_merge_bfqqs(bfqd, RQ_BIC(rq), | 4179 | bfq_merge_bfqqs(bfqd, RQ_BIC(rq), |
4164 | bfqq, new_bfqq); | 4180 | bfqq, new_bfqq); |
4181 | |||
4182 | bfq_clear_bfqq_just_created(bfqq); | ||
4165 | /* | 4183 | /* |
4166 | * rq is about to be enqueued into new_bfqq, | 4184 | * rq is about to be enqueued into new_bfqq, |
4167 | * release rq reference on bfqq | 4185 | * release rq reference on bfqq |