Re: [PATCH v5 20/29] cgroup/cpuset: Give back the bandwidth an attach did not move
From: Juri Lelli
Date: Fri Nov 13 2026 - 12:09:33 EST
On 13/11/26 11:14, Mathieu Desnoyers wrote:
> Hi Juri,
>
> > I believe we already have (maybe broken in-kernel) EBUSY on trying to
> > hotplug last cpu with bw standing?
>
> Yes, in dl_bw_manage(), for dl_bw_req_deactivate. It refuses a CPU
> offline in two cases:
> - the CPU is the last one of its root domain, and that root domain
> counts deadline bandwidth;
> - the CPUs that remain lack the capacity for that bandwidth.
>
> Both look at the root domain as a whole. The planned next version
> leaves that check as it is.
>
> The new refusal looks at each task. The root domain keeps other CPUs,
> but none that the task is allowed on.
>
> The case hotplug_last_refused of deadline_bw_test shows it, in a guest
> booted with isolcpus="domain". I1 and I2 are isolated CPUs, in the
> default root domain. H and K are housekeeping CPUs, in another root
> domain. B is a cpuset of I1, I2 and H, and is not a partition root. T
> is a deadline task, counted in the root domain of H and K. Without the
Oh, wow. So, this is indeed possible today, but of course completely
broken from a theory/AC point of view. Urgh. :)
IIUC, what you propose for v6 makes sense, in that at least it should
close holes we have today. We will then need find time in the future to
address what dl_bw_capacity() already points out:
* XXX Fix: If 'rq->rd == def_root_domain' perform AC against capacity
* of the CPU the task is running on rather rd's \Sum CPU capacity.
In the example above T should be restricted (and its bw accounted for)
to either I1, I2 or (H,K). It shouldn't be possible to admit it in a
cpuset spanning both isolated and housekeeping cpus like B.
Thanks,
Juri