Discussion:
[Rtai] Kernel Timestamp stall
Erik Rull
2018-11-05 18:59:10 UTC
Permalink
Hi all,

I have some rt_printk-outputs in hard realtime context.
They have the kernel timestamp in front of each log line.
I have not yet figured out why, but sometimes this timestamp seems to stop
incrementing for some successive rt_printks but keeping the pace of the clock
later (so no clock tick loss) - even if there is "a lot of" time between the
rt_printks - kernel got scheduled in between. It seems as if gaps of < 150usec
sometimes increment the printk-timestamp, sometimes not.

What could be the reason for this? The system has enough idle time to schedule
the kernel and it seems as if it is not predictable when this effect happens and
when not.
rt_get_real_time_ns() seems to deliver a correct time even in hard realtime / in
interrupt context.

RTAI is 4.0 and kernel is 3.4.67.

Thanks!

Best regards,

Erik
Alec Ari
2018-11-05 19:26:32 UTC
Permalink
Does the testsuite work ok? If you're using RTAI 4, can you give my RTAI 4 tree a shot?


https://github.com/NTULINUX/RTAI

Use the 3.16.52 kernel. If you're still having problems, give RTAI 5.1 a try with the kernel patches provided in the RTAI 5.1 tarball.

Alec
Erik Rull
2018-11-05 19:44:09 UTC
Permalink
Hi Alec,

I will try getting the testsuite to start since this is an embedded system, I
have to check if the test executables will start...

3.16.52 is currently not an option - too many changes...

I keep you updated.

Best regards,

Erik
Post by Alec Ari
Does the testsuite work ok? If you're using RTAI 4, can you give my RTAI 4 tree a shot?
https://github.com/NTULINUX/RTAI
Use the 3.16.52 kernel. If you're still having problems, give RTAI 5.1 a try with the kernel patches provided in the RTAI 5.1 tarball.
Alec
Erik Rull
2018-11-06 20:45:01 UTC
Permalink
Hi Alec,

there are several latency / timing tests - which one should I run? On the target
system I don't have the whole set of functions available.

Thanks.

Best regards,

Erik
Post by Erik Rull
Hi Alec,
I will try getting the testsuite to start since this is an embedded system, I
have to check if the test executables will start...
3.16.52 is currently not an option - too many changes...
I keep you updated.
Best regards,
Erik
Post by Alec Ari
Does the testsuite work ok? If you're using RTAI 4, can you give my RTAI 4 tree a shot?
https://github.com/NTULINUX/RTAI
Use the 3.16.52 kernel. If you're still having problems, give RTAI 5.1 a try with the kernel patches provided in the RTAI 5.1 tarball.
Alec
_______________________________________________
Rtai mailing list
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
Erik Rull
2018-11-06 22:01:09 UTC
Permalink
Here the results for the latency test:
RTAI Testsuite - USER latency (all data in nanoseconds)
2018/11/6 22:06:38
RTH| lat min| ovl min| lat avg| lat max| ovl max| overruns
RTD| 1721| 1721| 1928| 4637| 4637| 0
RTD| 1751| 1721| 1925| 5404| 5404| 0
RTD| 1721| 1721| 1925| 4437| 5404| 0
RTD| 1716| 1716| 1907| 5340| 5404| 0
RTD| 1662| 1662| 1911| 4998| 5404| 0
RTD| 1721| 1662| 1967| 5053| 5404| 0
RTD| 1697| 1662| 1939| 5531| 5531| 0
RTD| 1721| 1662| 1930| 4954| 5531| 0
RTD| 696| 696| 1930| 4608| 5531| 0
RTD| 1721| 696| 1928| 5234| 5531| 0
RTD| 1734| 696| 1925| 4439| 5531| 0
RTD| 1704| 696| 1896| 4588| 5531| 0
RTD| 1662| 696| 1930| 4571| 5531| 0
RTD| 672| 672| 1961| 4523| 5531| 0
RTD| 1721| 672| 1926| 5373| 5531| 0
RTD| 1746| 672| 1927| 5751| 5751| 0
RTD| 1726| 672| 1926| 5263| 5751| 0
RTD| 1731| 672| 1925| 4538| 5751| 0
RTD| 1749| 672| 1908| 4429| 5751| 0
RTD| 1697| 672| 1897| 4390| 5751| 0
RTD| 1358| 672| 1940| 5766| 5766| 0

The kernel test doesn't run on the target system...
Is this good or bad?

Best regards,

Erik
Post by Erik Rull
Hi Alec,
there are several latency / timing tests - which one should I run? On the target
system I don't have the whole set of functions available.
Thanks.
Best regards,
Erik
Post by Erik Rull
Hi Alec,
I will try getting the testsuite to start since this is an embedded system, I
have to check if the test executables will start...
3.16.52 is currently not an option - too many changes...
I keep you updated.
Best regards,
Erik
Post by Alec Ari
Does the testsuite work ok? If you're using RTAI 4, can you give my RTAI 4 tree a shot?
https://github.com/NTULINUX/RTAI
Use the 3.16.52 kernel. If you're still having problems, give RTAI 5.1 a try with the kernel patches provided in the RTAI 5.1 tarball.
Alec
_______________________________________________
Rtai mailing list
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
_______________________________________________
Rtai mailing list
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
Paolo Mantegazza
2018-11-07 09:02:08 UTC
Permalink
It's fine but, if run for a short time, maybe a bit too optimistic.
Without CPU isolation it is likely it will end in the range of 15-30 us.
Take into account that what you see is displayed in nanos.

Paolo
Post by Erik Rull
RTAI Testsuite - USER latency (all data in nanoseconds)
2018/11/6 22:06:38
RTH| lat min| ovl min| lat avg| lat max| ovl max| overruns
RTD| 1721| 1721| 1928| 4637| 4637| 0
RTD| 1751| 1721| 1925| 5404| 5404| 0
RTD| 1721| 1721| 1925| 4437| 5404| 0
RTD| 1716| 1716| 1907| 5340| 5404| 0
RTD| 1662| 1662| 1911| 4998| 5404| 0
RTD| 1721| 1662| 1967| 5053| 5404| 0
RTD| 1697| 1662| 1939| 5531| 5531| 0
RTD| 1721| 1662| 1930| 4954| 5531| 0
RTD| 696| 696| 1930| 4608| 5531| 0
RTD| 1721| 696| 1928| 5234| 5531| 0
RTD| 1734| 696| 1925| 4439| 5531| 0
RTD| 1704| 696| 1896| 4588| 5531| 0
RTD| 1662| 696| 1930| 4571| 5531| 0
RTD| 672| 672| 1961| 4523| 5531| 0
RTD| 1721| 672| 1926| 5373| 5531| 0
RTD| 1746| 672| 1927| 5751| 5751| 0
RTD| 1726| 672| 1926| 5263| 5751| 0
RTD| 1731| 672| 1925| 4538| 5751| 0
RTD| 1749| 672| 1908| 4429| 5751| 0
RTD| 1697| 672| 1897| 4390| 5751| 0
RTD| 1358| 672| 1940| 5766| 5766| 0
The kernel test doesn't run on the target system...
Is this good or bad?
Best regards,
Erik
Post by Erik Rull
Hi Alec,
there are several latency / timing tests - which one should I run? On the target
system I don't have the whole set of functions available.
Thanks.
Best regards,
Erik
Post by Erik Rull
Hi Alec,
I will try getting the testsuite to start since this is an embedded system, I
have to check if the test executables will start...
3.16.52 is currently not an option - too many changes...
I keep you updated.
Best regards,
Erik
Post by Alec Ari
Does the testsuite work ok? If you're using RTAI 4, can you give my RTAI 4 tree a shot?
https://github.com/NTULINUX/RTAI
Use the 3.16.52 kernel. If you're still having problems, give RTAI 5.1 a try with the kernel patches provided in the RTAI 5.1 tarball.
Alec
_______________________________________________
Rtai mailing list
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
_______________________________________________
Rtai mailing list
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
_______________________________________________
Rtai mailing list
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
Loading...