Re: [PATCH v5 18/29] sched/deadline: Move a task's bandwidth only where room was made
From: Mathieu Desnoyers
Date: Sun Nov 08 2026 - 21:59:40 EST
On 2026-11-08 14:30, sashiko-bot@xxxxxxxxxx wrote:
> skipped bandwidth move in __set_cpus_allowed_ptr_locked()
Thanks. The skip is real: an attach with an unchanged mask never reaches
set_cpus_allowed_dl(), and the reservation is given back. Both setups
you describe end at the wakeup, though. The task's old CPU is out of its
mask, so migrate_task_rq_dl() moves the bandwidth when it leaves that
CPU. A running task migrates before sched_setaffinity() returns.
The lasting case comes from dl_task_check_affinity(). It tests the root
domain of the CPU the task is on. A task moved asleep still sleeps in
the root domain it left. So sched_setaffinity() can take it out of the
root domain that counts it, and it then wakes on a CPU of its mask. The
next version makes the affinity check use the CPU recorded with the
bandwidth, and lets SCA_DL_BW_RESERVED skip the early exit. A new case,
affinity_moved_asleep, fails on v5 and passes with the fix.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com