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

From: Tejun Heo

Date: Fri Nov 27 2026 - 21:05:17 EST


Hello, Juri.

On Thu, Nov 26, 2026 at 08:25:50AM +0100, Juri Lelli 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)
...
> Tejun, is this the kind of usage you had in mind?

Yes, and let me build on it a bit because I think it also shows why
tying cpu.rt.max to cpuset is problematic.

Here, cpuset is what keeps the two sets of threads apart, but cpuset
isn't just for RT tasks. Say the process also has normal threads which
should be able to run anywhere on 0-10. The two children can't carry
different cpusets then. The RT threads would be affined instead and
crit would carry the budget so that only its threads use it:

P/ cpuset.cpus=0-10
cpu.rt.max: 4-10 runtime=400 period=1000
P/noncrit RT threads affined to 0-3
P/crit cpu.rt.max: 4-10 runtime=400 period=1000
RT threads affined to 4-10

cpuset confines everything in P, RT or not, to 0-10 and cpu.rt.max
says where the RT budget is. crit takes all of P's budget on 4-10, so
the noncrit threads have nothing to run on there and stay on 0-3. If
the budget followed cpuset, it gets tricky to express the restrictions
for the normal threads.

Now, say P sits under S and a second container Q is added next to it,
sharing 8-10 with P:

S/ cpu.rt.max: 4-14 runtime=500 period=1000
S/P/ cpuset.cpus=0-10
cpu.rt.max: 4-7 runtime=400 period=1000
8-10 runtime=200 period=1000
S/P/noncrit RT threads affined to 0-3
S/P/crit cpu.rt.max: 4-7 runtime=400 period=1000
8-10 runtime=200 period=1000
RT threads affined to 4-10
S/Q/ cpu.rt.max: 8-10 runtime=200 period=1000
11-14 runtime=400 period=1000

P and Q each have 200 out of S's 500 on 8-10 and 400 on the CPUs they
don't share. Nothing has an entry on 0-3 and the noncrit threads run
there as before. P and crit now need different budgets on different
CPUs, so expressing partial sharing takes full per-CPU config anyway.

I'm not familiar with the analysis side, but wouldn't it be okay for
the guarantees to come with conditions? e.g. If the crit threads stay
affined to 4-10, they get the budgets crit has there. A thread which
doesn't follow the setup gets whatever is left where it runs, which
may be nothing, as with a noncrit thread on 4-10 above.

I think something like this, per-CPU and independent of cpuset, is the
most orthogonal. Intertwining configs across controllers or CPUs is
likely to lead to complications in the future, many of which we can't
foresee now.

Thanks.

--
tejun