Re: [PATCH v5 18/29] sched/deadline: Move a task's bandwidth only where room was made
From: Waiman Long
Date: Fri Nov 13 2026 - 02:02:14 EST
On 11/8/26 1:53 PM, Mathieu Desnoyers wrote:
Commit 7f51412a415d ("sched/deadline: Fix bandwidth check/update when
migrating tasks between exclusive cpusets") moves a deadline task's
bandwidth in two halves. cpuset_can_attach() reserves it in the
destination root domain. set_cpus_allowed_dl() then frees it in the
source, when the task's affinity changes. Its comment relies on the
first half: "We already made space for us in the destination domain".
But set_cpus_allowed_dl() runs on every change of affinity. It frees
the bandwidth whenever the new mask leaves the task's root domain, with
or without a reservation. sched_setaffinity() gets there too, if the
task's cpuset spans two root domains. With admission control on,
For cpuset v2, it is not possible for a cpuset to span two root domains. I believe it is not possible for v1 too, though I am not 100% sure. Please let me know if you are aware of a way to do that.
Cheers,
Longman