Re: [PATCH v2] sched/deadline: Reset dl_server execution state on stop
From: Andrea Righi
Date: Tue Jan 27 2026 - 13:59:53 EST
On Tue, Jan 27, 2026 at 04:00:31PM +0000, Gabriele Monaco wrote:
> 2026-01-27T14:18:29Z Andrea Righi <arighi@xxxxxxxxxx>:
> > I think my case should work also doing something like this (I'll run some
> > tests later to double check):
> >
> > if (dl_se->runtime <= 0)
> > dl_se->dl_defer_running = 0;
> >
> > In this way:
> > - short sleep + remaining runtime > 0
> > - dl_defer_running stays set
> > - restart can go A->D directly
> > - no extra defer / zero-laxity penalty
> >
> > - stop with exhausted (or negative) runtime
> > - dl_defer_running is cleared
> > - restart must re-establish eligibility
> > - deferral / timer is armed again
> > - no stale "already running" server
>
> Yeah that looks like the neatest to me.
> Fair tasks are a bit more penalised than now but won't be if they really sleep before consuming the runtime, which I think was the whole point of this logic.
Unfortunately checking only runtime <= 0 isn't enough for the sched_ext DL
server case:
# Runtime of EXT task (PID 2025) is 0.000000 seconds
# Runtime of RT task (PID 2026) is 4.990000 seconds
# EXT task got 0.00% of total runtime
not ok 2 FAIL: EXT task got less than 4.00% of runtime
With the unconditional reset the EXT task gets 5% of the bandwidth. I'll
add some debugging to figure out exactly what is happening.
-Andrea