]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block, bfq: save also injection state on queue merging
authorPaolo Valente <paolo.valente@linaro.org>
Mon, 25 Jan 2021 19:02:47 +0000 (20:02 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jan 2021 21:18:35 +0000 (14:18 -0700)
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>
block/bfq-iosched.c
block/bfq-iosched.h

index 5d48cba07cb5088c2a147303c239d3c4de83b60c..79d232d41027f665d8c9d764bd82f14d6576dc51 100644 (file)
@@ -1024,6 +1024,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->io_start_time = bic->saved_io_start_time;
@@ -2748,6 +2752,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);
index d15299d59f89dc86c6e0937db2eff899d5c24528..3f350fa3c5fd617beb2a6ea15c8ab039aec87b20 100644 (file)
@@ -444,6 +444,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;
 };
 
 /**