OSDN Git Service

block, bfq: Init saved_wr_start_at_switch_to_srt in unlikely case
authorDouglas Anderson <dianders@chromium.org>
Wed, 26 Jun 2019 19:59:19 +0000 (12:59 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 26 Jun 2019 22:25:35 +0000 (16:25 -0600)
Some debug code suggested by Paolo was tripping when I did reboot
stress tests.  Specifically in bfq_bfqq_resume_state()
"bic->saved_wr_start_at_switch_to_srt" was later than the current
value of "jiffies".  A bit of debugging showed that
"bic->saved_wr_start_at_switch_to_srt" was actually 0 and a bit more
debugging showed that was because we had run through the "unlikely"
case in the bfq_bfqq_save_state() function.

Let's init "saved_wr_start_at_switch_to_srt" in the unlikely case to
something sane.

NOTE: this fixes no known real-world errors.

Reviewed-by: Paolo Valente <paolo.valente@linaro.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-iosched.c

index 72840eb..008c93d 100644 (file)
@@ -2678,6 +2678,7 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq)
                 * to enjoy weight raising if split soon.
                 */
                bic->saved_wr_coeff = bfqq->bfqd->bfq_wr_coeff;
+               bic->saved_wr_start_at_switch_to_srt = bfq_smallest_from_now();
                bic->saved_wr_cur_max_time = bfq_wr_duration(bfqq->bfqd);
                bic->saved_last_wr_start_finish = jiffies;
        } else {