* [PATCH] block,bfq: fix the timeout calculation in bfq_bfqq_charge_time
@ 2021-03-24 2:33 Rokudo Yan
2021-04-02 10:18 ` Paolo Valente
0 siblings, 1 reply; 2+ messages in thread
From: Rokudo Yan @ 2021-03-24 2:33 UTC (permalink / raw)
To: paolo.valente, axboe, linux-block; +Cc: wu-yan
in bfq_bfqq_charge_time, timeout_ms is calculated with global
constant bfq_timeout(HZ/8), which is not correct. It should be
bfqd->bfq_timeout here as per-device bfq_timeout can be modified
through /sys/block/<disk/queue/iosched/timeout_sync.
Signed-off-by: Rokudo Yan <wu-yan@tcl.com>
---
block/bfq-wf2q.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index 070e34a7feb1..48f540a5ee6a 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -872,7 +872,7 @@ void bfq_bfqq_charge_time(struct bfq_data *bfqd, struct bfq_queue *bfqq,
unsigned long time_ms)
{
struct bfq_entity *entity = &bfqq->entity;
- unsigned long timeout_ms = jiffies_to_msecs(bfq_timeout);
+ unsigned long timeout_ms = jiffies_to_msecs(bfqd->bfq_timeout);
unsigned long bounded_time_ms = min(time_ms, timeout_ms);
int serv_to_charge_for_time =
(bfqd->bfq_max_budget * bounded_time_ms) / timeout_ms;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] block,bfq: fix the timeout calculation in bfq_bfqq_charge_time
2021-03-24 2:33 [PATCH] block,bfq: fix the timeout calculation in bfq_bfqq_charge_time Rokudo Yan
@ 2021-04-02 10:18 ` Paolo Valente
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Valente @ 2021-04-02 10:18 UTC (permalink / raw)
To: Rokudo Yan; +Cc: Jens Axboe, linux-block
> Il giorno 24 mar 2021, alle ore 03:33, Rokudo Yan <wu-yan@tcl.com> ha scritto:
>
> in bfq_bfqq_charge_time, timeout_ms is calculated with global
> constant bfq_timeout(HZ/8), which is not correct. It should be
> bfqd->bfq_timeout here as per-device bfq_timeout can be modified
> through /sys/block/<disk/queue/iosched/timeout_sync.
>
Hi,
thanks for spotting this.
Reviewed-by: Paolo Valente <paolo.valente@linaro.org>
> Signed-off-by: Rokudo Yan <wu-yan@tcl.com>
> ---
> block/bfq-wf2q.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
> index 070e34a7feb1..48f540a5ee6a 100644
> --- a/block/bfq-wf2q.c
> +++ b/block/bfq-wf2q.c
> @@ -872,7 +872,7 @@ void bfq_bfqq_charge_time(struct bfq_data *bfqd, struct bfq_queue *bfqq,
> unsigned long time_ms)
> {
> struct bfq_entity *entity = &bfqq->entity;
> - unsigned long timeout_ms = jiffies_to_msecs(bfq_timeout);
> + unsigned long timeout_ms = jiffies_to_msecs(bfqd->bfq_timeout);
> unsigned long bounded_time_ms = min(time_ms, timeout_ms);
> int serv_to_charge_for_time =
> (bfqd->bfq_max_budget * bounded_time_ms) / timeout_ms;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-02 10:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 2:33 [PATCH] block,bfq: fix the timeout calculation in bfq_bfqq_charge_time Rokudo Yan
2021-04-02 10:18 ` Paolo Valente
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).