Hello,<br><br>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:<br><br>//exec_time in microseconds<br>
int loop_for(unsigned int exec_time) <br>{<br> int tmp = 0;<br> unsigned int elapsed = 0;<br> unsigned long long loop_start = 0, loop_end = 0;<br><br> while(elapsed < exec_time) {<br> loop_start = read_tsc_us(); // reads from the TSC and converts to microsecond<br>
tmp += loop_once();<br> loop_end = read_tsc_us(); <br> elapsed = elapsed + (loop_end - loop_start);<br> } <br><br> printf("elapsed = %d, exec_time = %d\n", elapsed, exec_time);<br>
<br> return tmp;<br>}<br>
<br>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:<br>
<br>elapsed = 13003, exec_time = 921<br>elapsed = 12999, exec_time = 921<br>elapsed = 13003, exec_time = 921<br>elapsed = 13007, exec_time = 921<br>elapsed = 13007, exec_time = 921<br>elapsed = 12998, exec_time = 921<br>elapsed = 12995, exec_time = 921<br>
elapsed = 12999, exec_time = 921<br>elapsed = 12990, exec_time = 921<br>elapsed = 921, exec_time = 921<br>elapsed = 13002, exec_time = 921<br><br>My guess is that the task is not running as a real-time task. Do I need to define any other parameter for LITMUS?<br>
<br>The application source code and the kernel config files are attached on this email.<br><br>Thanks in advance,<br>Giovani<br><br>