Re: [PATCH v7 12/40] sched/deadline: Replenish a throttled task boosted while asleep

From: Mathieu Desnoyers

Date: Wed Nov 18 2026 - 08:37:00 EST


> Does letting a sleeping boosted task fall through to
> replenish_dl_entity() corrupt its CBS accounting by refilling its
> pre-boost deficit from the donor's reservation parameters?

No, it does what the boost of a queued task does. I checked it by
reading. When a throttled task that is queued gets boosted,
rt_mutex_setprio() sets ENQUEUE_REPLENISH. replenish_dl_entity() then
refills it from the donor's parameters, with the same loop. That is
upstream behaviour. The timer now gives the sleeping task the same
refill. Before this patch, the sleeping task was not refilled at all. It
hung.

> dl_deboost() resets dl_se->deadline and dl_se->runtime to a full new
> period, forgiving any runtime overrun p owed before going to sleep.

The overrun of a throttled task is the delay of the overrun detection,
up to a tick. A queued task boosted while throttled gets the same.
Without the flag, the task would keep the donor's runtime after the
boost.

> the while loop above pays off p's overrun in multiples of the donor's
> smaller runtime and period, which can push p's boosted deadline
> several donor periods into the future.

The same loop runs for a queued throttled task at its boost. It is how
the base pays an overrun while boosted.

> and falsely trigger the "sched: DL replenish lagged too much" warning.

That message is printed once per boot. The code then starts a new
period. The queued case can print it too.

> If the donor left SCHED_DEADLINE and had its parameters cleared
> before dl_task_timer() runs, the !runtime branch in
> replenish_dl_entity() skips dl_note_donor_refill() and the deadline
> update because dl_se->dl_deadline is non-zero, leaving p's expired
> deadline in the past after dl_deboost().

That early return clears the throttle, which is what this patch needs.
The task keeps its own past deadline until its wakeup starts a new
period. A sleeping deadline task keeps the deadline of its last period
in general. The cover letter of the next version lists that under "Not
changed".

> Finally, if p changed policy while sleeping and boosted, refilling
> from the donor before 0-lag time leaves donor-derived runtime and
> deadline on p when rt_mutex_setprio() drops the boost via
> dl_drop_boost().

This is the known 0-lag point of patch 10. The cover letter lists it
under "Not changed".

Thanks,

Mathieu

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