[LITMUS^RT] Question about the RT_F_XXX flags
Jonathan Herman
hermanjl at cs.unc.edu
Mon Oct 1 21:29:34 CEST 2012
Hi John,
There is some term overloading going on here which causes confusion.
The is_running() macro does not refer to RT_F_RUNNING, nor is the
task_wake_up() call invoked when a task should go from RT_F_SLEEP to
RUNNING. RT_F_SLEEP is unrelated to blocking / waking up from
blocking.
As I see it, RT_F_SLEEP refers to tasks which should not be run
because they have completed their current job. Its only purpose is to
allow the complete_job() method (called from userspace) to mark a job
as "completed". This way, the subsequent call to psn_edf_schedule()
can prepare the job for its next period and arm any appropriate
timers.
I'm not sure why RT_F_RUNNING is set in requeue(). My guess is that it
avoids some race condition.
On Mon, Oct 1, 2012 at 2:27 PM, John Gamboa <vaulttech at gmail.com> wrote:
> Hello,
>
> I'm trying to write a schedule plugin. While reading the already made
> scheduler plugins, I got surprised about the use of the RT_F_SLEEP and
> RT_F_RUNNING.
>
> It makes sense for me that a task is flagged with "RT_F_SLEEP" when a job is
> completed and that it is flagged with "RT_F_RUNNING" in the task_new()
> function. On the other hand, I don't understand why a task is flagged as
> "RT_F_RUNNING" also in the task_wake_up() functions and not flagged as
> "RT_F_SLEEP" when it blocks (actually, I was expecting to have other flags
> for "blocked" and "awaken" in these cases). I though these were "symmetric"
> functions. In fact, I am surprised that the task_block() function doesn't
> make anything (only some checks) in the PSN-EDF plugin.
>
>
> Also, looking at the schedule() function, I saw that more or less the same
> test is normally done:
>
> blocks = exists && !is_running(pedf->scheduled);
>
>
> Why is a task flagged as "RT_F_RUNNING" when it wakes up, if this is not
> tested?
>
> I believe I'm getting something wrong anyway. I hope I can get things
> clearer with your help =)
>
>
> Thanks for your attention,
> --
> John Gamboa
> rabanetescebolas.blogspot.com
>
> _______________________________________________
> litmus-dev mailing list
> litmus-dev at lists.litmus-rt.org
> https://lists.litmus-rt.org/listinfo/litmus-dev
>
--
Jonathan Herman
Department of Computer Science at UNC Chapel Hill
More information about the litmus-dev
mailing list