Re: [PATCH v11 26/43] sched/deadline: Keep a departing constrained task until its next period
From: Mathieu Desnoyers
Date: Fri Nov 27 2026 - 08:50:14 EST
> Can dl_task_timer() advance dl_se->deadline before inactive_task_timer()
> computes dl_next_period(dl_se), holding the departed task's bandwidth for
> an extra period?
Yes, but this errs on the safe side. The refill starts the next period
of the task, with runtime. If the task comes back during that period,
it runs in it. So admission control must count it until then. v12 will
leave it as it is.
Lifting the throttle without the refill would not work. It forgives the
overrun of a task that comes back after its next period starts.
> Can returning HRTIMER_RESTART after task_rq_unlock() race with
> cancel_inactive_timer() in switched_to_dl() and leave inactive_timer
> queued after the task returns to SCHED_DEADLINE?
Yes. In v12, task_non_contending() will cancel such a timer before it
tests hrtimer_active(). A queued timer with dl_non_contending clear can
only be one left this way. The hrtimer_active() test then sees only a
handler that is running. That is the case the test is for.
Thanks,
Mathieu