Re: [RFC PATCH v6 00/25] Hierarchical Constant Bandwidth Server
From: Yuri Andriaccio
Date: Tue Jun 09 2026 - 12:55:37 EST
Hi Juri,
Thanks for looking into this.
> I started playing with the new interface and ended up with the following
>
> bash-5.3# cat cpu.rt.max (root)
> 10000 100000
> bash-5.3# cat g1/cpu.rt.max
> 10000 100000
> bash-5.3# cat g1/cpu.rt.internal
> 9999 100000
>
> which looks odd to me, as nothing is running on g1 yet and no children
> groups either. Maybe a rounding error of some kind?
You are right. I should have mentioned that it is just a rounding error that occurs when converting from a bandwidth value to a runtime value. This happens because the tg_rt_internal_bandwidth() function truncates the value when transforming the runtime from nanoseconds to micros. Rounding could be used here to report a more accurate value.
This same issue is probably found in the from_ratio() function, which has a similar truncation issue when converting from bandwidth to runtime, but since it is working in the nanoseconds range it might not be that big of a problem. The value from from_ratio() is used for the setup of the dl_servers even when the children bw is zero, so maybe it is possible to add a special case?
Anyways, as it is right now, the cpu.rt.internal may have only a +1/-1us error in reporting the actual used values, while the error for the runtime value used internally to setup the dl_servers is in the range of tens of nanoseconds.
Thanks,
Yuri