aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYahu Gao <[email protected]>2022-01-07 14:58:59 +0800
committerJens Axboe <[email protected]>2022-02-16 20:09:14 -0700
commitbcd2be763252f3a4d5fc4d6008d4d96c601ee74b (patch)
tree0b9b3a75437796bd4bcdff7f28a18df6e9118119
parent8f5fea65b06de1cc51d4fc23fb4d378d1abd6ed7 (diff)
block/bfq_wf2q: correct weight to ioprio
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 <[email protected]> Acked-by: Paolo Valente <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/bfq-wf2q.c2
1 files changed, 1 insertions, 1 deletions
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)