Re: [PATCH v6 10/37] sched/deadline: Reset the donor's runtime at a deboost in the class
From: Mathieu Desnoyers
Date: Tue Nov 17 2026 - 09:17:57 EST
> If the first donor's refill pushed p->dl.deadline past pi_task->dl.deadline,
> rt_mutex_setprio() takes the first branch and skips dl_deboost(). Because
> p->dl.dl_deadline is non-zero and p->dl.runtime > 0, replenish_dl_entity()
> leaves the first donor's remaining runtime and postponed deadline in place
> after the unlock.
The first branch does not clear dl_donor_refill. The flag set by the
first donor's refill stays set while the second donor boosts the task.
At the unlock, rt_mutex_setprio(p, NULL) takes the else branch. There,
dl_deboost() starts a new period. So the task does not keep the first
donor's values after the unlock.
A dl_deboost() at each change of top waiter would give the task a full
runtime of its own reservation each time.
> task_non_contending() then computes zerolag_time from the donor's refilled
> deadline and runtime combined with p's own dl_period and dl_runtime.
This is known. The cover letter lists it under "Not changed". At a
deboost, the 0-lag time of a task comes from the deadline and runtime
it ran on during the boost. Upstream does the same.
> otherwise p keeps the donor's runtime and deadline
> with dl_donor_refill cleared if it returns to SCHED_DEADLINE before the
> inactive timer fires.
On that return, patches 32 and 33 check the runtime left against the
task's own parameters, as a wakeup does. Only dl_deboost() reads the
flag, and the task is not boosted then.
> Does this break the build when CONFIG_RT_MUTEXES is disabled?
Yes. Fixed in the planned next version.
> Should the early return when !runtime earlier in replenish_dl_entity() also
> call dl_note_donor_refill(dl_se)?
Only where the early return starts a period from the donor. The
planned next version changes that early return in patch 8. It adds no
runtime, and resets a negative runtime to 0. It gives a deadline of now
to an owner with no parameters of its own, and notes a refill there. An
owner with parameters keeps its own deadline and runtime. Setting the
flag for it would give it a second full runtime in the same period.
> Should __dl_clear_params() also clear dl_donor_refill (or call
> dl_drop_boost()) instead of only setting dl_se->pi_se = dl_se?
Yes. Fixed in the planned next version.
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com