Re: strange scheduling latency results

Paolo Mantegazza <[email protected]> Wed, 12 Apr 2017 09:55:58 +0200
Newsgroups gmane.linux.real-time.rtai
Message-ID <[email protected]>
Since it looks like an architectural specific problem, I dare throwing a 
clue: skewed clock sources?
If I recall it well, something similar was what made the way to clock 
source time balancingin i386. The related support can still be 
configured, unfortunately albeit just for i386/x86_32.
AFAIK, such a feature was exploited just by the user that asked for it.
If you think that could be the problem then you should verify it with a 
32 bit installation. If it is a cure, then we could try to extend such a 
support to x86_64.
There is the alternative approach of using a single clock source mated 
to inteprocessor messages, to be  born again from older RTAI versions, 
but, being a latency adder, I never liked it.
Clearly, what said above is just an idea. Though, right now, I've 
nothing better to speculate on.

Paolo.

On 04/12/2017 12:30 AM, Sebastian Kuzminsky wrote:
> Hi there, a LinuxCNC user reports strange thread scheduling results on 
> an AMD A6-6400K.  This is with RTAI 3.9 and Linux 3.4.55, compiled for 
> i686 (32-bit x86 mode).  Other hardware runs this exact software 
> without the strange behavior described below.
>
> There are two realtime threads in this system, which we call the "base 
> thread" and the "servo thread".  The base thread runs with a 25 
> microsecond period, the servo thread with a 1 millisecond period.
>
> We have a test program called "latency-histogram" that runs the 
> threads and monitors scheduling latency, and presents the results as a 
> graphical histogram.  Here's a graph from this A6-6400K machine:
>
> https://imagebin.ca/v/3IkSuxnTVoWH
>
> Notice that the base thread (on the left) runs about when it's 
> scheduled, with a bell-shaped curve of jitter around the "0 
> microseconds of latency" point.
>
> But the servo thread histogram (on the right) looks different.  It too 
> has a bell curve of scheduling jitter, but it's not centered on 0.  It 
> looks like the servo thread consistently starts a handful of 
> microseconds before it's supposed to.
>
> Any suggestions for us to debug or deal with this issue?
>
>
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai