All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] "RT throttling" issue
@ 2015-11-26 10:32 JK.Behnke
  2015-11-28  6:43 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 13+ messages in thread
From: JK.Behnke @ 2015-11-26 10:32 UTC (permalink / raw)
  To: xenomai

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-12-08 12:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-26 10:32 [Xenomai] "RT throttling" issue JK.Behnke
2015-11-28  6:43 ` Gilles Chanteperdrix
2015-11-29  9:30   ` Jochen Behnke
2015-12-01 13:09   ` JK.Behnke
2015-12-01 18:11     ` Gilles Chanteperdrix
2015-12-02 12:58       ` JK.Behnke
2015-12-04 16:24         ` JK.Behnke
2015-12-04 16:33           ` Gilles Chanteperdrix
2015-12-04 19:09             ` Jochen Behnke
2015-12-04 20:41               ` Gilles Chanteperdrix
2015-12-08 10:42                 ` Jochen Behnke
2015-12-08 11:05                   ` Gilles Chanteperdrix
2015-12-08 12:12                     ` Jochen Behnke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.