Re: [PATCH v14 02/39] sched/deadline: Replenish a throttled task boosted while asleep
From: sashiko-bot
Date: Thu Dec 03 2026 - 10:29:07 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] sched/deadline: Fixes trailer cites feff2e65efd8 instead of
aee38ea95419
--
commit 43888afc681de375614e3f79133646abba848ae0
Author: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> sched/deadline: Replenish a throttled task boosted while asleep
>
> A deadline task can be throttled as it blocks, with an rt_mutex held.
> Its replenishment timer is then armed. A deadline waiter can boost the
> task while it sleeps.
>
> Commit feff2e65efd8 ("sched/deadline: Unthrottle PI boosted threads
> while enqueuing") lets a boost override the throttle. enqueue_task_dl()
> lifts the throttle of a boosted task, and dl_task_timer() ignores a
> boosted task. This covers a task that is enqueued while boosted. But a
> boost of a sleeping task does not enqueue it.
>
> T is a SCHED_DEADLINE task that holds the rt_mutex L. W is a
> SCHED_DEADLINE task with an earlier deadline:
>
> T W T's timer
>
> uses up its runtime, sleeps
> dl_throttled = 1
> start_dl_timer()
> pthread_mutex_timedlock(L)
> rt_mutex_setprio(T, W)
> T sleeps: no enqueue
> dl_task_timer()
> T is boosted: returns
> times out
> rt_mutex_setprio(T, NULL)
> wakes up
> enqueue_dl_entity()
> dl_throttled: waits for the timer
>
> The timer has already fired. T would never run again, not even to die
> of SIGKILL. Every later waiter on L would hang too. This was found by
> reading.
>
> Fix this by returning early in dl_task_timer() only for a boosted task
> that is queued. A boosted task that sleeps then takes the existing path
> for a throttled task that is not queued: it is replenished.
>
> The timer refills the task from the parameters of its donor. After the
> deboost, the task keeps the runtime and the deadline of that refill.
> Its wakeup then checks them against its own parameters, as any wakeup
> does. On v7.4-rc2, a queued boosted task also keeps the values of its
> donor after the deboost. The priority inheritance series gives the
> task its own values back.
>
> The refill relies on two earlier patches:
> - "sched/deadline: Hold a reference on the deadline donor of a boosted
> task" is earlier in this series. It keeps the donor from being freed
> while the task points to it. A chain walk that has not reached the
> task yet leaves it on an old donor. The refill then uses the
> parameters of that old donor, as for a queued boosted task.
> - "sched/deadline: Do not replenish a boost from cleared parameters" is
> in the first series. It keeps the refill from looping on the
> parameters of a donor that left the class.
>
> The Sashiko AI review of this series found this.
>
> Fixes: feff2e65efd8 ("sched/deadline: Unthrottle PI boosted threads while enqueuing")
> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx>
> Reviewed-by: Juri Lelli <juri.lelli@xxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
[Severity: Low]
Should the Fixes tag cite aee38ea95419 ("sched/deadline: Fix races
between rt_mutex_setprio() and dl_task_timer()") instead of feff2e65efd8
("sched/deadline: Unthrottle PI boosted threads while enqueuing")?
That commit only changed enqueue_task_dl() and did not touch
dl_task_timer(). The unconditional boosted early return in
dl_task_timer() was already present from the earlier commit, so this hang
existed before the enqueue_task_dl() change.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1796296313.git.mathieu.desnoyers@xxxxxxxxxxxx?part=2