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 <[email protected]> Acked-by: Paolo Valente <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 8f5fea6 commit bcd2be7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)