Re: [PATCH v6 28/37] cgroup/cpuset: Refuse to take a deadline task out of its root domain
From: Mathieu Desnoyers
Date: Tue Nov 17 2026 - 09:17:52 EST
> Can dl_tasks_keep_without() miscompute new_cpus for descendant cpusets and
> let a deadline task move to another root domain without admission control?
Yes. Fixed in the planned next version: the new masks are computed from
the top down, as update_cpumasks_hier() does.
> Does passing tmp->new_cpus to dl_tasks_keep_without() clobber excpus before
> it is copied to cs->effective_xcpus?
Yes, and with no deadline task at all. update_cpumasks_hier() computes
effective_xcpus again right after, so the wrong value does not last.
Only update_sibling_cpumasks(), called in between, can see it. This is
from reading: no test case showed a lasting effect. Fixed in the
planned next version with a scratch mask of its own.
> Can setting adding here when is_partition_invalid(cs) is true call
> partition_xcpus_del() on an already-invalid partition?
Yes. Fixed in the planned next version.
> What happens when a write to cpuset.cpus (or cpuset.cpus.exclusive)
> invalidates a valid partition root?
Right, the task can then run in a root domain that did not admit it, as
upstream does. The planned next version does not refuse this write, for
two reasons.
The same move happens on paths that cannot fail:
- CPU hotplug;
- a child partition made invalid after its parent, in
update_cpumasks_hier();
- a write of "member" to cpuset.cpus.partition.
A check on this write alone would not give a rule that holds.
The write path also cannot tell early whether the partition becomes
invalid. validate_partition(), prstate_housekeeping_conflict() and
update_parent_effective_cpumask() find that out, and the last one
already changes the state. Refusing would mean splitting
partition_cpus_change() into a compute step and an apply step. That is
too much for a fix meant for stable.
The rebuild then counts the task where it runs. The cover letter of the
planned next version lists this under "Not changed".
For cpuset.cpus.exclusive: on a cpuset that is not a partition root,
the exclusive CPUs do not change effective_cpus. On a partition root,
the change goes through update_parent_effective_cpumask() or
remote_cpus_update(), which have the check.
> Should dl_task_keeps_root_domain() account for p->user_cpus_ptr the way
> __set_cpus_allowed_ptr() and dl_task_bw_reserve_cpu() do?
Yes. Fixed in the planned next version, for masks that grow too.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com