Re: [RFC PATCH v7 00/29] Hierarchical Constant Bandwidth Server

From: Juri Lelli

Date: Thu Nov 26 2026 - 11:34:25 EST


On 26/11/26 15:57, luca abeni wrote:
> Hi all again,
>
> sorry about sending the n^th message, I just have an additional
> question to check if my understanding is correct.
>
>
> On Thu, 26 Nov 2026 08:25:50 +0100
> Juri Lelli <juri.lelli@xxxxxxxxxx> wrote:
> [...]
> > 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).
>
> Uhm... In my original "all of nothing" idea, my plan was not to set
> cpu.rt.max in P, and to set it only in P/crit. In this way, the RT
> threads in P/nocrit should be served by P's parent (up to the root),
> while the RT threads in P/crit are directly served by the dl servers
> configured in P/crit/cpu.rt.max.
>
> Would this solution address the requirements of this use-case?

If the admin configures the whole tree, yes, I think so.

In my understanding, it doesn't if P is delegated, though. Moving
threads between P/noncrit and P/crit needs write access to P (the common
ancestor), so P is what the container gets. P's own cpu.rt.max then
stays with the admin, while P/crit's is the container's to write. With P
at "max", nothing bounds what the container can reserve in P/crit, other
than what's left at the nearest configured ancestor (or the root).

So the admin has to put the cap on P. If P also had to carry entries
on CPUs 0-3, P/noncrit would be served by P there: with zero its RT
threads couldn't run at all, and with a budget they'd use a reservation
they don't need. Leaving P without entries on 0-3 (i.e. the mixed
config) is what lets them keep running as plain FIFO, as they do today.