Re: [PATCH v2] sched/deadline: Reset dl_server execution state on stop

From: Andrea Righi

Date: Fri Jan 30 2026 - 11:26:20 EST


Hi Peter,

On Fri, Jan 30, 2026 at 01:41:00PM +0100, Peter Zijlstra wrote:
> On Fri, Jan 30, 2026 at 01:26:20PM +0100, Peter Zijlstra wrote:
> > On Fri, Jan 30, 2026 at 01:24:13PM +0100, Peter Zijlstra wrote:
> > > On Wed, Jan 28, 2026 at 02:41:40PM +0100, Andrea Righi wrote:
> > >
> > > > Just to make sure we're testing the same thing, I'm currently using
> > > > https://git.kernel.org/pub/scm/linux/kernel/git/arighi/linux.git, branch
> > > > scx-dl-server.
> > > >
> > > > I'm running this test inside virtme-ng:
> > > > $ vng -vb --config tools/testing/selftests/sched_ext/config
> > > > $ vng -v -- tools/testing/selftests/sched_ext/runner -t rt_stall
> > >
> > > Apparently you also have to actually have that runner thing built from
> > > that tree.
> > >
> > > Anyway, all I seem to be able to get (on x86) is PASS: 1 :/
> >
> > Argh, that tree has the dodgy 'fix' in. Let me go revert that.
>
> This seems to work?

Great! Makes sense to me, I re-ran all my stress tests and everything looks
good on my side. FWIW,

Tested-by: Andrea Righi arighi@xxxxxxxxxx

Can we route this through your branch / want me to send a new patch?

Thanks!
-Andrea

>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 80c9559a3e30..aa3da4d3b8e3 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1036,6 +1036,12 @@ static void update_dl_entity(struct sched_dl_entity *dl_se)
> return;
> }
>
> + /*
> + * When [4] D->A is followed by [1] A->B, dl_defer_running
> + * needs to be cleared, otherwise it will fail to properly
> + * start the zero-laxity timer.
> + */
> + dl_se->dl_defer_running = 0;
> replenish_dl_new_period(dl_se, rq);
> } else if (dl_server(dl_se) && dl_se->dl_defer) {
> /*
> @@ -1654,6 +1660,12 @@ void dl_server_update(struct sched_dl_entity *dl_se, s64 delta_exec)
> * dl_server_active = 1;
> * enqueue_dl_entity()
> * update_dl_entity(WAKEUP)
> + * if (dl_time_before() || dl_entity_overflow)
> + * dl_defer_running = 0;
> + * replenish_dl_new_period();
> + * // fwd period
> + * dl_throttled = 1;
> + * dl_defer_armed = 1;
> * if (!dl_defer_running)
> * dl_defer_armed = 1;
> * dl_throttled = 1;