Skip to content

Commit bcd2be7

Browse files
YahuGaoaxboe
authored andcommitted
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 <gaoyahu19@gmail.com> Acked-by: Paolo Valente <paolo.valente@linaro.org> Link: https://lore.kernel.org/r/20220107065859.25689-1-gaoyahu19@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 8f5fea6 commit bcd2be7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

block/bfq-wf2q.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ unsigned short bfq_ioprio_to_weight(int ioprio)
519519
static unsigned short bfq_weight_to_ioprio(int weight)
520520
{
521521
return max_t(int, 0,
522-
IOPRIO_NR_LEVELS * BFQ_WEIGHT_CONVERSION_COEFF - weight);
522+
IOPRIO_NR_LEVELS - weight / BFQ_WEIGHT_CONVERSION_COEFF);
523523
}
524524

525525
static void bfq_get_entity(struct bfq_entity *entity)

0 commit comments

Comments
 (0)