Re: [RFC PATCH v7 00/29] Hierarchical Constant Bandwidth Server
From: Peter Zijlstra
Date: Mon Nov 30 2026 - 08:38:37 EST
On Fri, Nov 27, 2026 at 09:22:27PM -1000, Tejun Heo wrote:
> Hello, Juri.
>
> On Fri, Nov 27, 2026 at 03:35:54PM +0100, Juri Lelli wrote:
> ...
> > Either the entry's bandwidth
> > stays claimed while its CPU is unreachable, so cpuset changes never
> > fail but that bandwidth sits unused, or it's released and claimed again
> > when the CPU becomes reachable, which means growing a cpuset can fail
> > because of the cpu controller. Tejun, Peter, does either work for both
> > of you?
>
> My preference is the former. I'd like to avoid intertwining the two
> controllers as much as possible, so an entry would keep its bandwidth
> claimed whatever cpuset says and a cpuset change wouldn't fail because
> of cpu.rt.max.
I don't see how we can avoid failing extending the cpumask. At all times
the bandwidth allocated must be less or equal to 1.
If we have 4 CPUs, and 2 disjoint cpusets: A, B; then both A and B can
claim up to full bandwidth for each of their CPUs. The moment we want to
extend the cpumask of either group to overlap with the other, we must
guarantee the bandwidth allocation remains valid.
Example; let A have cpus 0,1 and B 2,3. Have them all have 0.8 bandwidth
for all CPUs. Then if we try and extend A to include CPU 2, that CPU
would end up with 1.6, which is not valid and must therefore be
rejected.
It is very simple, extending the cpumask adds bandwidth demand (the new
CPU(s) will need start their server for this cgroup), if this bandwidth
is not available, it cannot happen.