<div dir="ltr"><div>Hello Marov,</div><div><br></div><div>You'll probably want to use the <span style="font-family:monospace">exec_time</span> property of <span style="font-family:monospace">rt_job</span> to replace <span style="font-family:monospace">i</span> in your formula. You can access that property most easily with the <span style="font-family:monospace">get_exec_time()</span> macro from litmus.h.</div><div><br></div><div>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 <span style="font-family:monospace">hrtimer</span> (see <span style="font-family:monospace">sched_pfair.c</span>).<br></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><span style="font-family:arial,sans-serif">Also note that </span>litmus_clock()</span> is simply defined as <span style="font-family:monospace">ktime_to_ns(ktime_get())</span> and thus will increment at a much higher rate than you'll be scheduling at.</div><div><br></div><div>Best,</div><div><br></div><div>Joshua Bakita<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 23, 2020 at 3:33 PM Marov Gazaal <<a href="mailto:adamagaghz@gmail.com">adamagaghz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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:</div><div>laxity = get_deadline(first) - litmus_clock() - (get_execution_cost(first)-i );</div><div>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.</div><div><br></div><div>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").</div><div>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.</div><div><br></div><div>Thank you for your help.<br></div><div>Marouf<br></div><div><br></div><div><br></div><div><br></div><div> <br></div><div><br></div></div>
_______________________________________________<br>
litmus-dev mailing list<br>
<a href="mailto:litmus-dev@lists.litmus-rt.org" target="_blank">litmus-dev@lists.litmus-rt.org</a><br>
<a href="https://lists.litmus-rt.org/listinfo/litmus-dev" rel="noreferrer" target="_blank">https://lists.litmus-rt.org/listinfo/litmus-dev</a><br>
</blockquote></div>