block, bfq: save also injection state on queue merging

To prevent injection information from being lost on bfq_queue merging,
also the amount of service that a bfq_queue receives must be saved and
restored when the bfq_queue is merged and split, respectively.

Tested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 5a5436b98d5cd2714feaaa579cec49dd7f7057bb)
(cherry picked from commit 9372e98dc77c7f2ebbb808a60abb01f30d70d0bc)
(cherry picked from commit e6a5b66cfe56495f26182cfd2340e3336bb4b2b4)
(cherry picked from commit c579a3634d163ed05cc4ac258411f03db969926e)
(cherry picked from commit 359f87d07390f687634185b0dd9d6f106fb5afdd)
(cherry picked from commit d1d1f1336ed77b83e98d26175e196b45a28958f4)
(cherry picked from commit 0ff8068594640924e0cffe27d8b0273bb80d74ca)
This commit is contained in:
Paolo Valente 2021-01-25 20:02:47 +01:00 committed by Ksawlii
parent 0769622634
commit 5238084cd8
2 changed files with 13 additions and 0 deletions

View file

@ -1032,6 +1032,10 @@ bfq_bfqq_resume_state(struct bfq_queue *bfqq, struct bfq_data *bfqd,
else
bfq_clear_bfqq_IO_bound(bfqq);
bfqq->last_serv_time_ns = bic->saved_last_serv_time_ns;
bfqq->inject_limit = bic->saved_inject_limit;
bfqq->decrease_time_jif = bic->saved_decrease_time_jif;
bfqq->entity.new_weight = bic->saved_weight;
bfqq->ttime = bic->saved_ttime;
bfqq->wr_coeff = bic->saved_wr_coeff;
@ -2734,6 +2738,10 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq)
if (!bic)
return;
bic->saved_last_serv_time_ns = bfqq->last_serv_time_ns;
bic->saved_inject_limit = bfqq->inject_limit;
bic->saved_decrease_time_jif = bfqq->decrease_time_jif;
bic->saved_weight = bfqq->entity.orig_weight;
bic->saved_ttime = bfqq->ttime;
bic->saved_has_short_ttime = bfq_bfqq_has_short_ttime(bfqq);

View file

@ -436,6 +436,11 @@ struct bfq_io_cq {
unsigned long saved_wr_start_at_switch_to_srt;
unsigned int saved_wr_cur_max_time;
struct bfq_ttime saved_ttime;
/* Save also injection state */
u64 saved_last_serv_time_ns;
unsigned int saved_inject_limit;
unsigned long saved_decrease_time_jif;
};
/**