[LITMUS^RT] LLF policy and litmus_clock() function
Joshua Bakita
jbakita at cs.unc.edu
Tue Sep 29 20:22:12 CEST 2020
Hello Marov,
You'll probably want to use the exec_time property of rt_job to replace i
in your formula. You can access that property most easily with the
get_exec_time() macro from litmus.h.
Otherwise, please be aware that the "time unit" (quantum) that you'll be
using is 1ms at best (if you set CONFIG_HZ to 1000 - its fastest setting).
If you need higher granularity, you'll have to set up your own hrtimer (see
sched_pfair.c).
Also note that litmus_clock() is simply defined as ktime_to_ns(ktime_get())
and thus will increment at a much higher rate than you'll be scheduling at.
Best,
Joshua Bakita
On Wed, Sep 23, 2020 at 3:33 PM Marov Gazaal <adamagaghz at gmail.com> wrote:
> Hello all. I am trying to implement Least Laxity first scheduling policy,
> and as we know this policy makes its scheduling decisions by calling it at
> each time unit and takes the remaining execution cost into account. for
> this, I used litmus_clock() function in the laxity computation like this:
> laxity = get_deadline(first) - litmus_clock() -
> (get_execution_cost(first)-i );
> where i is a variable I used in some way to decrease the exec_cost of the
> task by 1 each time unit it executes.
>
> My question here is, does litmus_clock() function benefits to do laxity
> calculation at each time unit as I mentioned in the laxity relation above,
> or there is something else should be taken to make laxity computation
> excutes at each time unit( for instance, by using "for loop" as if we say
> "for each litmus_clock() tick ........ do laxity calculation").
> I took the gsn_edf policy file and I adjust it to include my code taking
> into account that it is "gsn" policy, but I want to be sure about the
> laxity calculation idea, so I ask you about it.
>
> Thank you for your help.
> Marouf
>
>
>
>
>
> _______________________________________________
> litmus-dev mailing list
> litmus-dev at lists.litmus-rt.org
> https://lists.litmus-rt.org/listinfo/litmus-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20200929/1248dde2/attachment.html>
More information about the litmus-dev
mailing list