Re: [PATCH v12 38/43] sched/deadline: Boost an owner that cannot run on its own reservation
From: Mathieu Desnoyers
Date: Tue Dec 01 2026 - 11:20:57 EST
> When a new top waiter with an earlier deadline replaces old_donor during
> a held boost (p->dl.dl_boost_held == 1 and old_donor != &p->dl), does
> rt_mutex_setprio() leave p->dl.deadline at the previous donor's later
> deadline?
Yes, in v12. The PI series, which will follow v13, adds
dl_boost_check_donor(). rt_mutex_setprio() calls it. When the new donor
has other parameters than those the period was placed with, it fits the
period to the new donor at once. It uses the rules that sched_setattr()
uses for a change of parameters. The new case pi_owner_swap_donor tests
this. A new donor with the same parameters keeps the period. A new
period at each change of donor would give the owner one donor runtime
per change.
> Can dl_deboost() fail to re-throttle a sleeping task whose held boost ends
> before its own next period?
It can, but the task keeps its negative runtime at its wakeup.
dl_entity_overflow() does not count a negative runtime as an overflow.
So update_dl_entity() keeps the runtime and the deadline of the task.
enqueue_dl_entity() then throttles the task until its next period, since
it has no runtime left. Patch 31, "sched/deadline: Restore the owner's
period at a deboost out of the class", adds that throttle. In v13, the
throttle will be in "sched/deadline: Keep the debt of a task across a
change of parameters".
> Can an unboosted owner whose deadline has passed outside its constrained
> gap be left with its stale past deadline when boosted while not queued?
Yes, as on v7.4-rc2. An owner that sleeps outside an rt_mutex gets a
period of the donor at its wakeup. An owner blocked on another rt_mutex
keeps its passed deadline in its waiter node. The PI series will list
this as a known limit: a waiter keeps the deadline it blocked with.
> Can dl_boost_donor_period() place dl_se->deadline far past the new donor's
> deadline when resuming a period across different donors?
Yes, in v12. In the PI series, dl_boost_donor_period() will no longer
take the saved period as it is. It will fit it to the current donor, by
the same rules. For that, the saved period records the parameters of its
donor. The PI series also removes boost_deadline, which nothing reads.
The new case pi_owner_reboost_periods tests a donor that changes its
period at each wait.
> Should dl_waiter_boosts() and dl_boost_start() use matching conditions for
> dl_se->runtime <= 0?
Yes. In the PI series, both will use the new dl_cannot_run_own(). It is
true for a task that is throttled, in its constrained gap, or out of
runtime with its deadline still ahead. A task with no runtime and a
passed deadline is compared at now + dl_deadline, as other owners past
their deadline are. So a sleeping owner deboosted after its own next
period is not boosted again at once. For an owner with no runtime left
before its own deadline, dl_boost_start() holds the boost and runs it on
a period of the donor.
> Does skipping dl_boost_start(&p->dl) here and when !dl_prio(p->normal_prio)
> in rt_mutex_setprio() miss holding the boost for a task that left
> SCHED_DEADLINE while throttled or in its constrained gap?
Yes. Such a task gets its boost held only at its first refill, in
dl_hold_refilled_boost(). That function saves a negative runtime as 0.
So the overrun of the task is forgiven, and its 0-lag time comes
earlier. A blocked task keeps its deadline in its waiter node, as in the
third answer. The PI series will leave both as they are. Its cover will
list them as known limits.
Thanks,
Mathieu