Re: [PATCH v13 05/36] sched/deadline: Keep a departing constrained task until its next period
From: Mathieu Desnoyers
Date: Wed Dec 02 2026 - 09:54:48 EST
> Can a throttled constrained task that leaves SCHED_DEADLINE end up keeping
> its bandwidth and deadline for an extra unused period?
Yes. At the end of the period, dl_task_timer() replenishes the
departed task, and starts its next period. The task then keeps its
bandwidth until the end of that period. That is too long, but safe: a
task that comes back before its new deadline runs in that period.
Sashiko found the same case in its v12 review of "sched/deadline:
Cancel the replenishment timer with the parameters". v14 will leave it
as it is.
> Can inactive_task_timer() release a departing task's bandwidth before its
> 0-lag time when task_non_contending() takes the pending early return?
Yes. The handler can wait for the rq lock while the task wakes up, runs
in a new period and leaves the class. It then acts on a time computed
from the old period. This is not new: v7.4-rc2 also releases the
bandwidth at once in this window. In v14, the handler will compute the
0-lag time again. For a constrained task, it will also compute the next
period again, and wait for the later of the two. It will call
dl_next_period() only when dl_se->deadline is not 0, as
task_non_contending() does.
Thanks,
Mathieu