blk-iocost: Move the usage ratio calculation to the correct place
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Thu, 26 Nov 2020 08:16:13 +0000 (16:16 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 7 Dec 2020 20:20:31 +0000 (13:20 -0700)
commitc09245f61c6ac4ef253a5fcf97e5bcfc0ce25fc7
treeaebe6c04e274f0688f649e98a8a1f0fc4a1fdf6f
parent647c9f03b2b66cf1f505208c313998fc833ed28b
blk-iocost: Move the usage ratio calculation to the correct place

We only use the hweight based usage ratio to calculate the new
hweight_inuse of the iocg to decide if this iocg can donate some
surplus vtime.

Thus move the usage ratio calculation to the correct place to
avoid unnecessary calculation for some vtime shortage iocgs.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iocost.c