Re: [RFC PATCH v7 00/29] Hierarchical Constant Bandwidth Server
From: luca abeni
Date: Thu Nov 26 2026 - 02:43:44 EST
Hi Juri,
On Thu, 26 Nov 2026 08:25:50 +0100
Juri Lelli <juri.lelli@xxxxxxxxxx> wrote:
[...]
> Just for my own (hopefully) better understanding, I tried to come up
> with a setup that uses a cgroup with entries on some CPUs and "max" on
> others, to reason about it more concretely. This is an illustration,
> not a deployment I actually know of:
[...]
Thanks for the example, it really clarifies things a lot for me!
I am going to look at it in more details, but, just to check if I
understand correctly: the "trick" here is that "P" does not contain any
RT thread, and all the RT threads are either in "P/noncrit" or
"P/crit", right?
Thanks again,
Luca
>
> A container runs a single RT process. A few threads (control loops)
> need a guaranteed budget. The other threads are FIFO as well (e.g.
> comms or watchdog threads that must preempt normal tasks promptly but
> use little CPU, or threads that simply inherited the policy), but
> need no guarantee, and shouldn't run on the reserved budget, as they
> would eat it while the loops sleep.
>
> P/ cpuset.cpus=0-10
> cpu.rt.max: 4-10 runtime=400 period=1000
> P/noncrit cpuset.cpus=0-3 (threaded, no cpu.rt.max entries)
> P/crit cpuset.cpus=4-10 (threaded, no cpu.rt.max entries)
>
> Threads in P/crit are served by P's servers on CPUs 4-10. Threads in
> P/noncrit find no entry up to the root on CPUs 0-3 and run as plain
> FIFO, as they do today. cpuset keeps the two sets apart, so no task
> ever moves between a server and the root runqueue, which I think
> addresses Luca's concern about tasks changing reservation on
> migration, at least for setups that care about the analysis.
>
> The mixed config ends up on P because of _delegation_. P's cpu.rt.max
> belongs to whoever delegated P, and it's what bounds how much the
> container can reserve. The application only arranges its threads below
> it. If a cgroup had to be "all or nothing", the admin would have to
> give P either zero on CPUs 0-3 (no RT threads there at all, not very
> flexible) or a budget there (reserving DL bandwidth for threads that
> don't need it).
>
> Tejun, is this the kind of usage you had in mind?
>
> Everybody, is something like this anywhere near what you think people
> might be asking for? Do you have any other examples in mind?
>