<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Feb 26, 2014, at 5:09 PM, ayoade gbadebo <<a href="mailto:gbaduz@gmail.com">gbaduz@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div>Please I need explanation on how <span style="white-space: pre-wrap;">arm_release_timer_on() works with ready queue and release queue to make sure jobs are released to run periodically.</span></div>
<div><span style="white-space: pre-wrap;"><br></span></div><div><span style="white-space: pre-wrap;">And also can this phrase be explained as shown in the plugin tutorial</span></div><div><span style="white-space: pre-wrap;"><br>
</span></div><div><span style="white-space: pre-wrap;">"</span><span style="font-family: sans-serif; font-size: 16px;">The preemption check callback is invoked by the </span><tt class="" style="">rt_domain_t</tt><span style="font-family: sans-serif; font-size: 16px;"> code whenever a job is transferred from the release queue to the ready queue (i.e., when a future release is processed). Since the callback is invoked from within the </span><tt class="" style="">rt_domain_t</tt><span style="font-family: sans-serif; font-size: 16px;"> code, the calling thread already holds the ready queue lock.</span><span style="white-space: pre-wrap;">"</span></div>
<div><span style="white-space: pre-wrap;"><br></span></div><div><font><span style="white-space:pre-wrap">In summary, who keeps check of when to actually rerun a job on the cpu? Is this ensured by the arm_release_timer.</span></font></div>
</div></blockquote><br></div><div>Litmus does some complicated things to make releases efficient.  Here’s how it works at a high level:</div><div>1) Job executes</div><div>2) When the job calls sleep_next_period() or the job has exhausted its budget, Litmus computes the time when the next job should be released.  Let’s call this time “next_release”.</div><div>3) If current_time >= next_release, then the next job is already eligible to run.  Litmus recomputes the deadline of the next job if you’re using a deadline scheduler.  It then inserts the next job directly into the ready-queue.</div><div>4) If current_time < next_release, then the next job is put on the release-queue, and Litmus sets a timer to raise a timer interrupt at time next_release.  The timer is set using arm_release_timer() (or arm_release_timer_on() if you’ve compiled Litmus with CONFIG_RELEASE_MASTER).  At a later time when the timer interrupt is raised, Litmus moves all jobs in the release-queue with release times <= current_time to the ready-queue.</div><div><br></div><div>Note: Litmus uses high-resolution timers to track release times for all of its plugins.  However, you could conceivably write a plugin that checks the release-queue on every scheduler tick (every quantum).  I believe Björn may have explored this approach in this paper: <a href="http://www.cs.unc.edu/~anderson/papers/rtss09a.pdf">http://www.cs.unc.edu/~anderson/papers/rtss09a.pdf</a></div><div><br></div><div>-Glenn</div></body></html>