Re: [PATCH v13 05/36] sched/deadline: Keep a departing constrained task until its next period

From: Juri Lelli

Date: Thu Dec 03 2026 - 02:27:58 EST


On 02/12/26 13:02, Mathieu Desnoyers wrote:

...

> One question. The inactive timer can be armed in one period. Its
> handler can then wait for the rq lock while the task runs a new period.
> If the task leaves the class then, task_non_contending() releases the
> bandwidth at once, as on v7.4-rc2. This is before the 0-lag time of the
> new period. The root domain can then admit another task into that
> bandwidth too early. The task itself keeps its deadline, so it gains no
> runtime. v13 closed this window with the timer restart. Is this window
> fine with you, or should the planned next version close it?

I'd leave it open. It is on v7.4-rc2 already, the rework doesn't make it
wider, and it is hard to hit: nothing holds the rq lock across the
wakeup, the run and the class change, and once the handler spins on
pi_lock/rq lock the queued spinlock lets it in after a few short
sections. The handler's CPU has to stall between __run_hrtimer() marking
the timer running and task_rq_lock(), for about a period of the task (a
preempted vCPU?).

Maybe we can list it as a known limit or corner case.

Thanks for picking up the two fixes and the bail as separate patches,
and for the new test case. I'll look at the reworked version when it's
out (but, again, it might take a while as, after today, I will only be
back for a week on the 14th before disappearing again until new year :).

Thanks,
Juri