Re: [RFC PATCH v7 00/29] Hierarchical Constant Bandwidth Server
From: luca abeni
Date: Fri Nov 27 2026 - 10:09:44 EST
Hi Peter,
On Fri, 27 Nov 2026 12:48:28 +0100
Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
[...]
> Still slowly working my way through all this email :/ So bear with me
> if I missed things already discussed elsewhere.
>
>
> So my suggestion to make all this cgroup-v2 only and couple with
> cpuset is exactly because of the bandwidth accounting. Specifically,
> cgroup-v2 makes it possible to map a cgroup to a cpumask (exactly
> like we do in tg_cpus()). This in turn means we have a natural limit
> on the bandwidth consumption -- a cgroup's deadline servers will
> never run outside this mask and will thus never consume bandwidth
> outside of it.
Yes, I agree that this is much simpler and makes a lot of sense from
the theoretical point of view.
But if I understand the comments on Yuri's last patchset correctly (I
hope I am actually misunderstanding them :), this is not flexible
enough...
> Without this, you get to account every cgroup to all CPUs, which is
> incredibly pessimistic; to the point of not actually being worth it.
Yes, this is the first part of Yuri's patchset. In the last patches,
however, it allows setting the dl server parameters per-core (so, it is
possible to set runtime=0 for all the cores we do not need, avoiding
the problem you mention - if I understand well)
> As to bandwidth accounting; I once started adding per-cpu
> reservations. Sadly I never finished it and I seem to have misplaced
> those patches. But yes, that is something that wants to be done.
>
> I'm not sure I see how all this can function without having that TBH.
> All this runs on a giant pile of per-cpu servers; without strict
> per-cpu accounting much goes out the window.
In the current patchset, the admission test is performed both per-core
for the dl servers (so that we avoid overloading any core), and
globally (the maximum utilization of all the dl servers is added in
the "standard" SCHED_DEADLINE admission test).
Juri is proposing to keep this "double admission test", but adding the
actual utilization of the dl servers instead of the maximum one (which
will work, I think... I think there are papers by Anderson showing that
this kind of admission test is fine when we have a mix of pinned and
global tasks - but I need to double check)
[...]
> As to the whole max thing; am I understanding things right if I say
> this means the cgroup itself will not have a constraint? I saw talk
> about one cgroup having mixed constaint and no constraint CPUs?
> That's crazy talk and makes absolutely no sense. Please don't support
> this.
I do not like this mix, either. But I think the last example by Juri
shows that this kind of configuration might be needed (and we do not
want to end up with something that all the distributions will disable
because of some interface issue :)
>From some discussion, I reached the conclusion that this kind of "mixed
configuration" might be needed only for non-leaf cgroups (and that
these cgroups should probably not directly contain any tasks), but I do
not know enough about cgroup-v2 to be sure...
Thanks,
Luca
> Either a cgroup has a constraint or it does not.
>
> I would suggest that writing a reservation into the file that is not
> specific to a CPU, results in (runtime/nr_cpus, period) for all CPUs;
> where nr_cpus is the cpuset's effective weight.
>
>