Hi,
在 2025/02/25 9:24, Ming Lei 写道:
- if (!time_elapsed)
+ /* don't trim slice until at least 2 slice is used */
+ if (time_elapsed < tg->td->throtl_slice * 2)
return;
If you just want to fix throtl/001, the above patch might
work(sometimes, it might not, and timer may expire by 2 jiffies), but it
is easy to fail other tests, such as, reduce the bps limit a bit, and
increase BS a bit to make the IO cross exactly two slices.
That's fine, the key point is the following code, above code is
just to make sure there is still at least one slice to trim after
removing the last slice.
+ /* dispite the last slice, trim previous slice */
+ time_elapsed -= tg->td->throtl_slice;
In this case, if one BIO cross 1+ slices, the rate is the same as
expected in the previous slices, we can trim them without any negative
impact.
Thanks,
Kuai
Also the big question is that how you can make sure that rate is always
good when the window is >= 2 slice?
Thanks,
Ming
.