* [PATCH] block, bfq: Init saved_wr_start_at_switch_to_srt in unlikely case
@ 2019-06-26 19:59 Douglas Anderson
2019-06-26 20:12 ` Guenter Roeck
2019-06-26 22:25 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Douglas Anderson @ 2019-06-26 19:59 UTC (permalink / raw)
To: Paolo Valente, Jens Axboe
Cc: groeck, drinkcat, Douglas Anderson, linux-block, linux-kernel
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.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Paolo Valente <paolo.valente@linaro.org>
---
Paolo said to add his Reviewed-by in https://crrev.com/c/1678756.
block/bfq-iosched.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 72840ebf953e..008c93d6b8d7 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -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 {
--
2.22.0.410.gd8fdbe21b5-goog
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block, bfq: Init saved_wr_start_at_switch_to_srt in unlikely case
2019-06-26 19:59 [PATCH] block, bfq: Init saved_wr_start_at_switch_to_srt in unlikely case Douglas Anderson
@ 2019-06-26 20:12 ` Guenter Roeck
2019-06-26 22:25 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-06-26 20:12 UTC (permalink / raw)
To: Douglas Anderson
Cc: Paolo Valente, Jens Axboe, Guenter Roeck, Nicolas Boichat,
linux-block, linux-kernel
On Wed, Jun 26, 2019 at 1:00 PM Douglas Anderson <dianders@chromium.org> wrote:
>
> 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.
>
> Signed-off-by: Douglas Anderson <dianders@chromium.org>
> Reviewed-by: Paolo Valente <paolo.valente@linaro.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
>
> ---
> Paolo said to add his Reviewed-by in https://crrev.com/c/1678756.
>
> block/bfq-iosched.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 72840ebf953e..008c93d6b8d7 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -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 {
> --
> 2.22.0.410.gd8fdbe21b5-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block, bfq: Init saved_wr_start_at_switch_to_srt in unlikely case
2019-06-26 19:59 [PATCH] block, bfq: Init saved_wr_start_at_switch_to_srt in unlikely case Douglas Anderson
2019-06-26 20:12 ` Guenter Roeck
@ 2019-06-26 22:25 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2019-06-26 22:25 UTC (permalink / raw)
To: Douglas Anderson, Paolo Valente
Cc: groeck, drinkcat, linux-block, linux-kernel
On 6/26/19 1:59 PM, Douglas Anderson wrote:
> 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.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-26 22:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 19:59 [PATCH] block, bfq: Init saved_wr_start_at_switch_to_srt in unlikely case Douglas Anderson
2019-06-26 20:12 ` Guenter Roeck
2019-06-26 22:25 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®