Messages in this thread | | | Date | Mon, 16 May 2022 08:46:07 -1000 | From | Tejun Heo <> | Subject | Re: [PATCH] blk-iocost: fix very large vtime when iocg activate |
| |
On Mon, May 16, 2022 at 04:40:45PM +0800, Chengming Zhou wrote: > When the first iocg activate after blk_iocost_init(), now->vnow > maybe smaller than ioc->margins.target, cause very large vtarget > since it's u64. > > vtarget = now->vnow - ioc->margins.target; > atomic64_add(vtarget - vtime, &iocg->vtime); > > Then the iocg's vtime will be very large too, larger than now->vnow.
It's a wrapping counter. Please take a look at how time_before64() and friends work.
Nacked-by: Tejun Heo <tj@kernel.org>
Again, please spend more effort understanding the code before sending these subtle patches.
Thanks.
-- tejun
| |