[LITMUS^RT] Question about the RT_F_XXX flags

John Gamboa vaulttech at gmail.com
Mon Oct 1 22:43:12 CEST 2012


2012/10/1 Jonathan Herman <hermanjl at cs.unc.edu>

> Hi John,
>

Hi. Thanks for the quick answer!

>
> 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.
>

Yes. I see it. That's why I suggested (or, actually, was expecting) some
flags for "blocked" and "woken up", which would be set at task_block() and
task_wake_up(), respectively. Then I could test if a task is running and
blocked with something like "get_rt_flags(t) == (RT_F_RUNNING |
RT_F_BLOCKED)".

Although I feel that creating these flags (say, "RT_F_BLOCKED" and
"RT_F_WOKEN_UP") there in my code wouldn't create any mess, I believe that
the code is the way it is now for some reason. Supposing that a possible
reason could be: the Linux kernel already provides a way to verify if a
task is blocked or woken up (at least, for me, it is what is seems), then
should I consider the "is_running()" macro the "right" way to verify it?
(i.e., is there any case in which it won't work?)


Thanks for the help!
-- 
John Gamboa
rabanetescebolas.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20121001/6f0f4e78/attachment.html>


More information about the litmus-dev mailing list