[LITMUS^RT] running a task as its execution time

Giovani Gracioli giovanig at gmail.com
Wed Apr 25 21:05:15 CEST 2012


Hello,

I am new at using LITMUS and I am facing some issues that maybe you can
help. I want to make sure that a task will execute only for its pre-defined
execution time, like this:

//exec_time in microseconds
int loop_for(unsigned int exec_time)
{
    int tmp = 0;
    unsigned int elapsed = 0;
    unsigned long long loop_start = 0, loop_end = 0;

    while(elapsed < exec_time) {
        loop_start = read_tsc_us(); // reads from the TSC and converts to
microsecond
        tmp += loop_once();
        loop_end = read_tsc_us();
        elapsed = elapsed + (loop_end - loop_start);
    }

   printf("elapsed = %d, exec_time = %d\n", elapsed, exec_time);

    return tmp;
}

I choose the GSN-EDF scheduler by running "setsched" of liblitmus before
running the test application. The problem is that, the most of times, the
elapsed time is greater than the execution time. Here is a part of the
output:

elapsed = 13003, exec_time = 921
elapsed = 12999, exec_time = 921
elapsed = 13003, exec_time = 921
elapsed = 13007, exec_time = 921
elapsed = 13007, exec_time = 921
elapsed = 12998, exec_time = 921
elapsed = 12995, exec_time = 921
elapsed = 12999, exec_time = 921
elapsed = 12990, exec_time = 921
elapsed = 921, exec_time = 921
elapsed = 13002, exec_time = 921

My guess is that the task is not running as a real-time task. Do I need to
define any other parameter for LITMUS?

The application source code and the kernel config files are attached on
this email.

Thanks in advance,
Giovani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20120425/4b464ac2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config
Type: application/octet-stream
Size: 131975 bytes
Desc: not available
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20120425/4b464ac2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.c
Type: text/x-csrc
Size: 7076 bytes
Desc: not available
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20120425/4b464ac2/attachment.c>


More information about the litmus-dev mailing list