Re: [PATCH v3 09/17] sched/deadline: Reset the deadline and the runtime with the parameters

From: Mathieu Desnoyers

Date: Thu Nov 19 2026 - 11:06:42 EST


> Can a task still keep its donor's runtime and deadline after a priority
> inheritance deboost when p->dl.dl_runtime is non-zero?

Yes, by reading. This is older than this patch, and the second series
fixes it:
- "sched/deadline: Reset the donor's runtime at a deboost in the class"
starts a new period at the deboost when the boost refilled the
runtime from the donor. Its message names this sched_setattr() case.
- "sched/deadline: Check the runtime of a task whose parameters change"
checks the new parameters at the deboost.
- "sched/deadline: Count the bandwidth a boosted task is given" adds
the bandwidth to this_bw for a task that sleeps during the
sched_setattr().

> Similarly, if a former SCHED_DEADLINE task is PI-boosted and deboosted
> before its 0-lag inactive_timer fires, switched_to_dl() cancels
> inactive_timer while p->dl.dl_runtime is still non-zero. On deboost,
> switched_from_dl() skips the !p->dl.dl_runtime reset and passes the
> donor's deadline and runtime to task_non_contending().

Right, with one correction. The boost keeps the task's own runtime and
deadline. replenish_dl_entity() copies the donor's only for a task with
no parameters. The donor's values come in when the boosted task runs out
of runtime and is refilled from the donor. The 0-lag time then mixes
them with the task's own parameters. The bandwidth is released too early
or too late. This is older than this patch too.

v8 of the second series will add "sched/deadline: Start a period at a
deboost out of the class". After a refill from the donor,
switched_from_dl() starts a period of the task's own, as the deboost in
the class does. The bandwidth is then released at once. Its new case,
deboost_out_after_donor_refill, failed in 40 runs of 40 without it.

> Does clearing deadline, runtime, and dl_throttled here without canceling
> dl_se->dl_timer leave a stale replenishment timer armed for the old
> period?

Right, and older than this patch. The second series fixes it in
"sched/deadline: Cancel the replenishment timer with the parameters".

Thanks,

Mathieu

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