* [PATCH] block/bfq_wf2q: correct weight to ioprio
@ 2022-01-07 6:58 gaoyahu19
2022-01-19 14:56 ` Paolo Valente
2022-02-17 2:51 ` Jens Axboe
0 siblings, 2 replies; 4+ messages in thread
From: gaoyahu19 @ 2022-01-07 6:58 UTC (permalink / raw)
To: paolo.valente, axboe; +Cc: linux-block, Yahu Gao
From: Yahu Gao <gaoyahu19@gmail.com>
The return value is ioprio * BFQ_WEIGHT_CONVERSION_COEFF or 0.
What we want is ioprio or 0.
Correct this by changing the calculation.
Signed-off-by: Yahu Gao <gaoyahu19@gmail.com>
diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
index b74cc0da118e..709b901de3ca 100644
--- a/block/bfq-wf2q.c
+++ b/block/bfq-wf2q.c
@@ -519,7 +519,7 @@ unsigned short bfq_ioprio_to_weight(int ioprio)
static unsigned short bfq_weight_to_ioprio(int weight)
{
return max_t(int, 0,
- IOPRIO_NR_LEVELS * BFQ_WEIGHT_CONVERSION_COEFF - weight);
+ IOPRIO_NR_LEVELS - weight / BFQ_WEIGHT_CONVERSION_COEFF);
}
static void bfq_get_entity(struct bfq_entity *entity)
--
2.15.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] block/bfq_wf2q: correct weight to ioprio
2022-01-07 6:58 [PATCH] block/bfq_wf2q: correct weight to ioprio gaoyahu19
@ 2022-01-19 14:56 ` Paolo Valente
2022-02-03 3:18 ` Yahu Gao
2022-02-17 2:51 ` Jens Axboe
1 sibling, 1 reply; 4+ messages in thread
From: Paolo Valente @ 2022-01-19 14:56 UTC (permalink / raw)
To: gaoyahu19; +Cc: axboe, linux-block
> Il giorno 7 gen 2022, alle ore 07:58, gaoyahu19@gmail.com ha scritto:
>
> From: Yahu Gao <gaoyahu19@gmail.com>
>
> The return value is ioprio * BFQ_WEIGHT_CONVERSION_COEFF or 0.
> What we want is ioprio or 0.
> Correct this by changing the calculation.
>
> Signed-off-by: Yahu Gao <gaoyahu19@gmail.com>
>
Thanks for spotting this error!
Acked-by: Paolo Valente <paolo.valente@linaro.org>
> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
> index b74cc0da118e..709b901de3ca 100644
> --- a/block/bfq-wf2q.c
> +++ b/block/bfq-wf2q.c
> @@ -519,7 +519,7 @@ unsigned short bfq_ioprio_to_weight(int ioprio)
> static unsigned short bfq_weight_to_ioprio(int weight)
> {
> return max_t(int, 0,
> - IOPRIO_NR_LEVELS * BFQ_WEIGHT_CONVERSION_COEFF - weight);
> + IOPRIO_NR_LEVELS - weight / BFQ_WEIGHT_CONVERSION_COEFF);
> }
>
> static void bfq_get_entity(struct bfq_entity *entity)
> --
> 2.15.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block/bfq_wf2q: correct weight to ioprio
2022-01-19 14:56 ` Paolo Valente
@ 2022-02-03 3:18 ` Yahu Gao
0 siblings, 0 replies; 4+ messages in thread
From: Yahu Gao @ 2022-02-03 3:18 UTC (permalink / raw)
To: Paolo Valente; +Cc: axboe, linux-block
On 2022/1/19 10:56 下午, Paolo Valente wrote:
>
>> Il giorno 7 gen 2022, alle ore 07:58, gaoyahu19@gmail.com ha scritto:
>>
>> From: Yahu Gao <gaoyahu19@gmail.com>
>>
>> The return value is ioprio * BFQ_WEIGHT_CONVERSION_COEFF or 0.
>> What we want is ioprio or 0.
>> Correct this by changing the calculation.
>>
>> Signed-off-by: Yahu Gao <gaoyahu19@gmail.com>
>>
> Thanks for spotting this error!
>
> Acked-by: Paolo Valente <paolo.valente@linaro.org>
friendly ping...
>> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
>> index b74cc0da118e..709b901de3ca 100644
>> --- a/block/bfq-wf2q.c
>> +++ b/block/bfq-wf2q.c
>> @@ -519,7 +519,7 @@ unsigned short bfq_ioprio_to_weight(int ioprio)
>> static unsigned short bfq_weight_to_ioprio(int weight)
>> {
>> return max_t(int, 0,
>> - IOPRIO_NR_LEVELS * BFQ_WEIGHT_CONVERSION_COEFF - weight);
>> + IOPRIO_NR_LEVELS - weight / BFQ_WEIGHT_CONVERSION_COEFF);
>> }
>>
>> static void bfq_get_entity(struct bfq_entity *entity)
>> --
>> 2.15.0
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block/bfq_wf2q: correct weight to ioprio
2022-01-07 6:58 [PATCH] block/bfq_wf2q: correct weight to ioprio gaoyahu19
2022-01-19 14:56 ` Paolo Valente
@ 2022-02-17 2:51 ` Jens Axboe
1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2022-02-17 2:51 UTC (permalink / raw)
To: paolo.valente, gaoyahu19; +Cc: linux-block
On Fri, 7 Jan 2022 14:58:59 +0800, gaoyahu19@gmail.com wrote:
> From: Yahu Gao <gaoyahu19@gmail.com>
>
> The return value is ioprio * BFQ_WEIGHT_CONVERSION_COEFF or 0.
> What we want is ioprio or 0.
> Correct this by changing the calculation.
>
>
> [...]
Applied, thanks!
[1/1] block/bfq_wf2q: correct weight to ioprio
commit: c766ace687d7ba1cbb485759f19ef33b35fb1b4a
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-17 2:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 6:58 [PATCH] block/bfq_wf2q: correct weight to ioprio gaoyahu19
2022-01-19 14:56 ` Paolo Valente
2022-02-03 3:18 ` Yahu Gao
2022-02-17 2:51 ` Jens Axboe
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).