Message ID | 20220107065859.25689-1-gaoyahu19@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block/bfq_wf2q: correct weight to ioprio | expand |
> Il giorno 7 gen 2022, alle ore 07:58, gaoyahu19@gmail.com ha scritto: > > From: Yahu Gao <gaoyahu19@gmail.com> > > 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> > Thanks for spotting this error! Acked-by: Paolo Valente <paolo.valente@linaro.org> > 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 >
On 2022/1/19 10:56 下午, Paolo Valente wrote: > >> Il giorno 7 gen 2022, alle ore 07:58, gaoyahu19@gmail.com ha scritto: >> >> From: Yahu Gao <gaoyahu19@gmail.com> >> >> 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> >> > Thanks for spotting this error! > > Acked-by: Paolo Valente <paolo.valente@linaro.org> friendly ping... >> 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 >>
On Fri, 7 Jan 2022 14:58:59 +0800, gaoyahu19@gmail.com wrote: > From: Yahu Gao <gaoyahu19@gmail.com> > > 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,
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)