Hello,
 
in my xenomai 2.6.3 application I sporadically experience very long execution 
times of
a task that switches back and forth between secondary and primary mode.
 
I added the following code to measure elapsed and cpu time
//------------- start code snippet ---------------
struct rusage rsgT1;
struct rusage rsgT2;
struct timeval tvT1;
struct timeval tvT2;
gettimeofday(&tvT1, NULL);
getrusage(RUSAGE_SELF, &rsgT1);
//
// code block to be measured
//
gettimeofday(&tvT2, NULL);
getrusage(RUSAGE_SELF, &rsgT2);
//------------- end code snippet ---------------

I then calculate the difference and keep the maximum values in
CpuMax (getrusage) and TimeMax (gettimeofday) variables.

Typically I observe CpuMax=20 .. 100 ms and TimeMax with similar values.
But sometimes I get huge CpuMax values in the range 5000 .. 50000 ms.

Now my questions
In my system logfile I sometimes observe "RT throttling activated" messages.
According to the Linux kernel 3.8.13 documentation the Linux scheduler throttles
RT tasks, if they comsume too much cpu time.
Could the observed behaviour be related to this?

Is it a problem, if I call gettimeofday/getrusage multiple times in
a loop and the loop is executed every 10 ms?

I would expect TimeMax to always be greater or equal CpuMax.
But sometimes I observe CpuMax values that are significantly larger than
TimeMax during the same test session.
Any ideas what might be the cause?



Thanks for any comments
Jochen

_______________________________________________
Xenomai mailing list
[email protected]
http://xenomai.org/mailman/listinfo/xenomai

Reply via email to