Re: [PATCH v5 20/29] cgroup/cpuset: Give back the bandwidth an attach did not move

From: Mathieu Desnoyers

Date: Fri Nov 13 2026 - 11:50:38 EST


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
new check:

root domain of H and K root domain of I1 and I2

T sleeps on H
echo T > B/cgroup.procs
T is allowed on I1, I2 and H
total_bw still counts T
echo 0 > cpuH/online
dl_bw_manage(): K remains, with
enough capacity. Accepted.
T wakes up on I1 or I2
T was not admitted here

The new check refuses the offline of H with EBUSY. H is the last CPU
that T is allowed on in the root domain that counts it.

With admission control off, the new check is skipped. The existing one
is not.

About a potential dedicate knob, Sebastian is proposing it as well [1],
so maybe it's time we move to that. Need to sync with him I guess. :)

Agreed. The two refusals test dl_bandwidth_enabled(), not the sysctl.
So they follow whichever file turns admission control off. With
Sebastian's patch 5, that is /sys/kernel/sched/dl_runtime_us.

What depends on the file is text and tests on my side:
- two changelogs name sched_rt_runtime_us as the way past a refusal;
- deadline_bw_test writes it for its cases without admission control.

Sebastian, the planned next version is based on tip sched/urgent, so
it names sched_rt_runtime_us. If your series goes in first, I rebase
on it and switch both. If mine goes in first, the selftest needs the
new path in your patch 5. Tell me which you prefer.

Thanks,

Mathieu


--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com