Thread (4 messages) 4 messages, 3 authors, 2022-02-17

Re: [PATCH] block/bfq_wf2q: correct weight to ioprio

From: Paolo Valente <hidden>
Date: 2022-01-19 14:56:41

Il giorno 7 gen 2022, alle ore 07:58, gaoyahu19@gmail.com ha scritto:

From: Yahu Gao <redacted>

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 <redacted>
Thanks for spotting this error!

Acked-by: Paolo Valente <redacted>
quoted hunk ↗ jump to hunk
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
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help