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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> Il giorno 7 gen 2022, alle ore 07:58, gaoyahu19@xxxxxxxxx ha scritto:
> 
> From: Yahu Gao <gaoyahu19@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> 

Thanks for spotting this error!

Acked-by: Paolo Valente <paolo.valente@xxxxxxxxxx>

> 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
> 




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux