Re: [PATCH v8 26/33] sched/deadline: Start a period for a task that enters the class blocked

From: Mathieu Desnoyers

Date: Fri Nov 20 2026 - 08:53:02 EST


> Does gating replenish_dl_new_period() on dl_task_pi_blocked() leave
> p->dl.deadline at 0 for tasks that sleep with p->pi_blocked_on == NULL?

Yes, by reading, for the requeue: FUTEX_CMP_REQUEUE_PI copies the stale
deadline into the waiter. v7.4-rc2 does the same. This patch covers only
a task with pi_blocked_on set. A fix would start a period at the proxy
lock, when the deadline has passed. I would rather do it in a follow-up,
with a test.

Your second case, a sleeping owner with a deadline of 0, is older too.
It belongs with the missing boost check of patch 32: same follow-up.

Your third case is not a bug. The owner is not a waiter, so nothing uses
its deadline until it wakes up. The wakeup then runs update_dl_entity()
from its donor.

> Can checking !dl_se->dl_deadline in dl_boost_blocked() miss a non-deadline
> task that recently left SCHED_DEADLINE before its 0-lag time?

Yes, by reading. The waiter is then sorted by an expired deadline. On
v7.4-rc2, a deadline waiter blocked past its deadline is sorted the same
way. A follow-up can also start a period for a task out of the policy
whose deadline has passed.

> What happens when sched_setattr() gives a SCHED_DEADLINE reservation to a
> blocked task that is already in dl_sched_class (for instance, because it
> was boosted into the class by priority inheritance)?

The state stays consistent. A boosted task runs on its donor's
parameters, and its waiter takes the deadline it runs with. Its own
parameters apply at the deboost. dl_deboost() then starts its own period
and checks its runtime. The chain walk requeues the waiter.

Thanks,

Mathieu

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