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

From: Tejun Heo

Date: Fri Nov 20 2026 - 01:46:25 EST


Hello, Luca.

I'm only thinking about this from the interface POV, so please read
the following with that in mind.

On Thu, Nov 19, 2026 at 03:14:16PM +0100, luca abeni wrote:
> ... 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.
...
> 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").

If the interface is per-CPU, I think it should be per-CPU all the way.
What a cgroup has on one CPU shouldn't say anything about what it has
on another. That seems the most consistent in itself and with the
other controllers.

Take Juri's example of a top-level group which has an entry only for
CPU0. Its tasks are limited on CPU0 and not on CPU1, which is what the
config says. io.max works the same way. A limit on one device says
nothing about the other devices, and a device without an entry is at
"max". If the group shouldn't run RT tasks on CPU1, it can be given
runtime=0 there.

Tasks moving across CPUs doesn't change how the resources are
allocated. A task consumes from whatever serves its cgroup on the CPU
it's running on.

I'm not too familiar with the schedulability analysis side, so please
correct me if I'm missing something. Wouldn't it work if the setups
which need the analysis configure the group on all CPUs? That seems
like something which can be a convention in how groups are configured
rather than forced through the interface, which looks like it'd get
clunky whichever shape we pick.

> 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?

Yeah, zero doesn't work there. How about defaulting the root to "max"
like the other cgroups? "max" on the root would mean that nothing is
set aside for cgroups. RT tasks which aren't under any entry run
without a server as they do now, and the budgets of top-level cgroups
are admitted against the DL bandwidth directly. An entry on the root
would be the total that cgroup servers can reserve on that CPU, and
writing one fails if what's already reserved doesn't fit. RT tasks in
the root itself keep running without a server either way.

Thanks.

--
tejun