Re: [RFC PATCH v7 00/29] Hierarchical Constant Bandwidth Server
From: luca abeni
Date: Thu Nov 19 2026 - 09:14:36 EST
Hi all,
first of all, sorry about the delay, Yuri and I have been discussing
these issues for some time before replying. See our conclusions below.
On Tue, 17 Nov 2026 22:07:04 -1000
Tejun Heo <tj@xxxxxxxxxx> wrote:
[...]
> On Wed, Nov 11, 2026 at 06:56:57PM +0100, Yuri Andriaccio wrote:
> > - `cpu.rt.max` only accepts per-CPU settings, so the global
> > "default" is removed. Removing all overrides means the cgroup is a
> > "max" cgroup, while just a single override means that the cgroup
> > has its own budget.
> > + This new interface disallows zero-runtime overrides, as a zero
> > override is equal to an empty override when there is at least one
> > non-zero override. As an example: [<CPU0 10ms 100ms>, <CPU1 0ms
> > 100ms>] is equal to just having [<CPU0 10ms 100ms>]. This seems a
> > 100ms>bit odd, how to make this better?
>
> It's odd because a missing entry means "max" when there are no entries
> and zero when there are some.
Yes, we agree this behaviour looks wrong, and should be removed,
however...
> Can a missing entry always mean "max",
> per CPU? On a CPU that a cgroup has no entry for, its tasks would be
> served by the nearest ancestor which has one.
... We believe that mixing "max" cores and cores configured with
(runtime, period) in the same cgroup is problematic, for various
reason. From the theoretical point of view, this would mean that when
migrating between cores a task can "move" from one reservation to a
different one, creating issues for schedulability analysis. All the
(runtime, period) deadline entities in a cgroup form a multi-core
reservation, as in MPR
(https://repository.upenn.edu/entities/publication/5cd778fe-4d0b-45a9-ae9e-cef48209bd8a)
if some cores are "max" and some are attached to (runtime, period)
deadline entities, the tasks move between two different multi-core
reservations, without control.
So, what about a different idea: a cgroup can be "max" or have
(runtime,period); when we set (runtime,period), this is set for all the
CPU cores, but then we can override (with runtime 0, or different
runtime/period) some cores (but we cannot override with "max").
This way, "0" still has one single meaning (no real-time tasks on this
core), but we do not mix "max" and "(runtime,period)" in the same
cgroup... Would this be acceptable?
> Zero then becomes a
> regular value which is shown on read, and the two configs in your
> example are different. The former can't run RT tasks on CPU1. The
> latter runs them on the ancestor's budget there.
We believe this property can be valid with the proposal above, too.
[...]
> The root has no ancestor to fall back to, so a missing entry can't
> mean anything there. It has to always carry an entry for every
> possible CPU, which defaults to zero, and reject "max":
>
> 0-127 runtime=0 period=1000000
We think 0 as a default would be problematic, as it means "no real-time
tasks", and 0 in the root means "no real-time tasks in all the
cgroups"... Or am I missing your point?
> > - `cpu` and `cpuset` controllers are decoupled, as it was before
> > the `cpuset` integration patch. The user/admin is responsible for
> > inconsistencies between the two controllers (i.e. empty
> > intersection between active server in the rt-cgroup and the allowed
> > cpuset just disallows executing RT tasks entirely).
>
> Yes, let's decouple them. With that, can the CPU offline lockout go
> away too? An entry for an offline CPU can stay configured and take
> effect again when the CPU comes back.
Let's decouple them, then. I am not sure about offline CPUs.
> One more thing on the unprivileged FIFO/RR tasks in cgroups. No other
> cgroup resource config grants privileges that way. e.g. If an rlimit
> is set on memory, memory.low doesn't do anything to work around it. I
> think who can use RT policies should be left to system configuration,
> i.e. RLIMIT_RTPRIO and CAP_SYS_NICE. Can you drop that patch?
OK, let's drop this patch.
Thanks,
Luca