Re: [PATCH v2 10/16] sched/deadline: Release the bandwidth of a task that leaves the class asleep
From: Mathieu Desnoyers
Date: Thu Nov 19 2026 - 08:39:43 EST
> Can task_non_contending() compute a bogus zerolag_time here when a
> sleeping task had its deadline parameters updated before leaving the
> class?
Yes. The new parameters take effect at the next period. Until then,
task_non_contending() mixes them with the old runtime and deadline.
This is older than this patch. A task can change its parameters while
it runs, then block. The dequeue then gets the same mix. This patch
adds one more path to it. I will look at it in a separate patch.
> Also, in the same calculation, dl_se->runtime * dl_se->dl_period is
> evaluated in unscaled 64-bit arithmetic (unlike dl_entity_overflow(),
> which shifts by DL_SCALE), so valid parameters within the default
> sysctl_sched_dl_period_max (~4.19s, e.g. dl_period = 4s and remaining
> runtime = 2.4s) overflow S64_MAX and wrap the dividend negative, pushing
> zerolag_time past the deadline.
Right. This is older than this patch too. "sched/deadline: Fix an
overflow of the 0-lag time with long periods" fixes it [1]. As Juri
suggested, it will come before this patch in v3.
[1] https://lore.kernel.org/all/0863470611fb7fda03d12c4c12cc8e715476d9ae.1794926626.git.mathieu.desnoyers@xxxxxxxxxxxx/
Thanks,
Mathieu
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com