Re: [PATCH 3/2] sched/deadline: Use deadline instead of period when calculating overflow
From: Juri Lelli
Date: Wed Feb 15 2017 - 09:16:58 EST
On 15/02/17 14:33, Daniel Bristot de Oliveira wrote:
> On 02/15/2017 01:59 PM, Juri Lelli wrote:
> > Actually, another thing that we noticed, talking on IRC with Peter, is
> > that we seem to be replenishing differently on different occasions:
>
> When a task is awakened (not by the replenishment timer), it is not
> possible to know if the absolute deadline var stores the absolute
> deadline of activation which took place in the instant
> (current time) - dl_period.
>
> Therefore, assuming the next deadline is one dl_deadline away from now
> is correct.
>
> IOW: that is a sporadic activation - the task is activated after at
> least minimum inter-arrival time between activation/replenishment:
>
> > - on wakeup (if overflowing) we do
> >
> > dl_se->deadline = rq_clock(rq) + pi_se->dl_deadline;
> > dl_se->runtime = pi_se->dl_runtime;
>
>
> In the replenishment timer, it is known that the absolute deadline
> instant of the previous activation is in the deadline var. So
> putting the absolute deadline one dl_period away is correct [1].
>
> Another point is that this case avoids creating time drift due
> to latencies. For instance, in the case of a 1 ms delay of the timer
> (interrupts disabled?), the wakeup replenishment would push the
> absolute a relative deadline + 1 ms away from the previous deadline.
>
> IOW: the replenishment timer makes the periodic case - a fixed time
> offset from the previous activation/replenishment.
>
> > - when the replenishment timer fires (un-thottle and with runtime < 0)
> >
> > dl_se->deadline += pi_se->dl_period;
> > dl_se->runtime += pi_se->dl_runtime;
>
> So I think it is correct. Am I missing something?
>
Nope, you are right, no problems here.
Thanks,
- Juri