Skip to contentSkip to conversation

block/bfq_wf2q: correct weight to ioprio

PATCH Applied [email protected] 3 participants 4 messages Jan 7, 2022 – Feb 17, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/bfq_wf2q: correct weight to ioprio

From: Yahu Gao <[email protected]>

The return value is ioprio * BFQ_WEIGHT_CONVERSION_COEFF or 0. What we want is ioprio or 0.
Correct this by changing the calculation.

block/bfq-wf2q.c +1 -1
index b74cc0da118e..709b901de3ca 100644
@@ -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)
Signature · 1 line
2.15.0
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines

Il giorno 7 gen 2022, alle ore 07:58, [email protected] ha scritto:

Quoted 8 lines

From: Yahu Gao <[email protected]>

The return value is ioprio * BFQ_WEIGHT_CONVERSION_COEFF or 0. What we want is ioprio or 0.
Correct this by changing the calculation.

Thanks for spotting this error!

Quoted 16 lines
block/bfq-wf2q.c +1 -1
index b74cc0da118e..709b901de3ca 100644
@@ -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)
Signature · 1 line
2.15.0
author
#2 lore raw
Quoted 9 lines · Paolo Valente
Quoted 9 lines

Il giorno 7 gen 2022, alle ore 07:58, [email protected] ha scritto:

From: Yahu Gao <[email protected]>

The return value is ioprio * BFQ_WEIGHT_CONVERSION_COEFF or 0. What we want is ioprio or 0.
Correct this by changing the calculation.

Quoted 5 lines
Quoted 2 lines

Thanks for spotting this error!

friendly ping...

Quoted 16 lines
Quoted 16 lines
block/bfq-wf2q.c +1 -1
index b74cc0da118e..709b901de3ca 100644
@@ -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)
Signature · 1 line
2.15.0
maintainer Applied
#3 lore raw
In reply to [email protected]
Quoted 8 lines · On Fri, 7 Jan 2022 14:58:59 +0800, [email protected] wrote:

From: Yahu Gao <[email protected]>

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,

Signature · 1 line
Jens Axboe