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

From: luca abeni

Date: Mon Nov 23 2026 - 09:19:09 EST


On Mon, 23 Nov 2026 11:22:03 +0100
Juri Lelli <juri.lelli@xxxxxxxxxx> wrote:

> Hello!
>
> Me again interjecting, please bear with me, but I think we want to get
> this as right as we can. :)
>
> On 23/11/26 08:43, luca abeni wrote:
> > Hi Tejun,
> >
> > On Sat, 21 Nov 2026 07:24:36 -1000
> > Tejun Heo <tj@xxxxxxxxxx> wrote:
> >
> > > Hello, Luca.
> > >
> > > On Fri, Nov 20, 2026 at 09:24:18PM +0100, luca abeni wrote:
> > > > But the deadline entities serving the real-time tasks in a
> > > > cgroup are pinned to cores (one dl entity serves the cgroup's
> > > > RT rq for a core). So, they cannot just be added to the sum
> > > > mentioned above (which works for dl entities which are free to
> > > > migrate). This issue was solved by reserving a fraction of the
> > > > CPU time (and the root cgroup parameters indicated this
> > > > fraction) to RT cgropus, so that the SCHED_DEADLINE admission
> > > > control is still the same (we just decrease "limit" by the
> > > > fraction reserved to RT cgroups).
> > >
> > > I see. Can the fraction be the maximum across the CPUs then? With
> > > the root at "max", the kernel knows how much the cgroup servers
> > > have reserved on each CPU. If "limit" is decreased by the largest
> > > of those on all CPUs, every CPU has at least what its servers
> > > need set aside and the admission control for tasks stays the same.
> > >
> > > I'm not familiar with the admission test, so I may be missing
> > > something.
> >
> > Uhm... I think this can increase the code complexity, but yes, I
> > guess it can work.
>
> What about a slightly different approach? Instead of reserving a
> fraction up front (or the max across CPUs), cgroup servers could be
> accounted like fair/ext servers already are: each server adds its
> bandwidth to total_bw of its root domain, and on top of the global
> test we check, per CPU, that pinned bandwidth (cgroup servers plus
> fair/ext servers) stays within the limit.

I am not sure about the SP theory, but if this solution is fine with
kernel maintainers, I think this will work, too (it is even better, as
it reduces work for Yuri :)



Luca


>
> IIUC reading your RTNS'21 paper with Stephen and Jim [1] right, those
> are its conditions (1) and (2) for semi-partitioned systems, and
> together they keep the system feasible. Did I get that right? The
> catch is that the paper also needs changes to the migration logic (no
> throttle bypass for tardy tasks, and the pushed task not counted in
> cpudl when looking for a target) for tardiness to stay bounded, and
> AFAIK we don't yet have that in mainline.
>
> So today's DL isn't "pinned aware", but we already live with that:
> fair/ext servers are pinned and simply added to total_bw. I don't
> think this series should fix that too. What I'd suggest instead is:
>
> 1. keep the interface per-CPU as Tejun proposed, and do admission as
> above (sum into total_bw plus per-CPU check). When a config is
> symmetric across the CPUs of a root domain, this is the same as
> today's uniform reservation, so it works with the current DL
> implementation with the same guarantees we have now;
>
> 2. accept asymmetric configs too, but document that, until DL becomes
> aware of pinned bandwidth, they come with no tardiness guarantees
> for DL tasks (as with non-default fair server settings today).
> Once the migration side is fixed (the paper's changes, or
> something similar), they get the guarantees without any interface
> change.
>
> This also avoids the cost of the max approach, where 50% on one CPU
> takes 50% of DL capacity on all CPUs of the root domain, and it should
> be less code, since cgroup servers would just follow the dl_server
> accounting paths (dl_server_apply_params(), dl_server_add_bw() on
> root domain rebuilds), but Yuri should keep me honest here. :)
>
> The root entry would then just limit what cgroups can reserve per CPU,
> on top of the above, which I think is what Tejun described.
>
> Thoughts?
>
> 1 - https://www.cs.unc.edu/~anderson/papers/rtns21a.pdf
>