Skip to contentSkip to conversation

negative values of latency/klatency

Xenomai-help Rudolf Marek 3 participants 6 messages Feb 27, 2006 – Feb 28, 2006

lore
Share & tools
lore
#0 lore raw

Hello all,

I tried the latency and klatency demo on some PPC procesor(s) (e500 and 60x) and the measurement results are rather strange. I observed this with arbitrary version of Adeos/ipipe and on Xenomai 2.0.3 older 2.0.x too.

-sh-3.00# ./run -- -T 10 -h -l 5
...

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4323|        5777|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1777|       0|       -4525|        5777
RTD|       -4525|       -4444|        -565|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1656|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1979|       0|       -4525|        5777
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4444|       -2020|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1050|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1616|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1898|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1939|       0|       -4525|        5777

...
Well if I set scheduling latency from automatic "0" to "1" I get:

-sh-3.00# ./run -- -T 10 -h -l 5

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4767|        4929|       15191|       0|        4767|       15191
RTD|        4767|        4808|        8282|       0|        4767|       15191
RTD|        4767|        4808|        8080|       0|        4767|       15191
RTD|        4808|        4808|        7838|       0|        4767|       15191
RTD|        4767|        4808|        7272|       0|        4767|       15191
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4808|        4808|        7555|       0|        4767|       15191
RTD|        4767|        4808|        7959|       0|        4767|       15191
RTD|        4767|        4808|        7393|       0|        4767|       15191
RTD|        4808|        4808|        7191|       0|        4767|       15191
RTD|        4767|        4808|        7313|       0|        4767|       15191

Is this a bug or feature please? Can someone throw the light? Good would be to print the units to the numbers too (ns).

Thank you,

Regards,
Rudolf

chipset : 8541E
Vendor : Freescale Semiconductor
Machine : CDS - MPC8541E (11)
clock : 396MHz

#1 lore raw
Quoted 21 lines · Rudolf Marek

Hello all,

I tried the latency and klatency demo on some PPC procesor(s) (e500 and 60x) and the measurement results are rather strange. I observed this with arbitrary version of Adeos/ipipe and on Xenomai 2.0.3 older 2.0.x too.

-sh-3.00# ./run -- -T 10 -h -l 5
...

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4323|        5777|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1777|       0|       -4525|        5777
RTD|       -4525|       -4444|        -565|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1656|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1979|       0|       -4525|        5777
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4444|       -2020|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1050|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1616|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1898|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1939|       0|       -4525|        5777
Quoted 2 lines

...
Well if I set scheduling latency from automatic "0" to "1" I get:

0 means automatic latency compensation (which does not seem to work that well here, it overcompensates), while 1 effectively means "no hardware/software scheduling latency" (=> 1 ns). See also help of the related kernel configuration parameters.

Quoted 18 lines

-sh-3.00# ./run -- -T 10 -h -l 5

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4767|        4929|       15191|       0|        4767|       15191
RTD|        4767|        4808|        8282|       0|        4767|       15191
RTD|        4767|        4808|        8080|       0|        4767|       15191
RTD|        4808|        4808|        7838|       0|        4767|       15191
RTD|        4767|        4808|        7272|       0|        4767|       15191
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4808|        4808|        7555|       0|        4767|       15191
RTD|        4767|        4808|        7959|       0|        4767|       15191
RTD|        4767|        4808|        7393|       0|        4767|       15191
RTD|        4808|        4808|        7191|       0|        4767|       15191
RTD|        4767|        4808|        7313|       0|        4767|       15191
Quoted 3 lines

Is this a bug or feature please? Can someone throw the light? Good would be to print the units to the numbers too (ns).

That was likely a layout question of the latency tool's output. We could simply dump something like "All latencies in nanoseconds" during start-up. Would this be more helpful?

Jan

#2 lore raw
Quoted 27 lines · Jan Kiszka
Quoted 21 lines · Rudolf Marek

Hello all,

I tried the latency and klatency demo on some PPC procesor(s) (e500 and 60x) and the measurement results are rather strange. I observed this with arbitrary version of Adeos/ipipe and on Xenomai 2.0.3 older 2.0.x too.

-sh-3.00# ./run -- -T 10 -h -l 5
...

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4323|        5777|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1777|       0|       -4525|        5777
RTD|       -4525|       -4444|        -565|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1656|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1979|       0|       -4525|        5777
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4444|       -2020|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1050|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1616|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1898|       0|       -4525|        5777
RTD|       -4525|       -4444|       -1939|       0|       -4525|        5777
Quoted 2 lines

...
Well if I set scheduling latency from automatic "0" to "1" I get:

Quoted 2 lines

0 means automatic latency compensation (which does not seem to work that well here, it overcompensates),

Dynamic determination of the intrinsic latency during nucleus startup has been dropped some time ago (circa fusion 0.6.8), because it just did not provide accurate results. Since then, when 0 is specified in Kconfig, the value read from include/asm-*/calibration.h is substituted. In this case, 9500 ns are taken for a ppc32 platform, which is likely too high for this board. Setting ~4500 in Kconfig would better approximate the latency.

while 1 effectively means "no

Quoted 40 lines

hardware/software scheduling latency" (=> 1 ns). See also help of the related kernel configuration parameters.

Quoted 17 lines

-sh-3.00# ./run -- -T 10 -h -l 5

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4767|        4929|       15191|       0|        4767|       15191
RTD|        4767|        4808|        8282|       0|        4767|       15191
RTD|        4767|        4808|        8080|       0|        4767|       15191
RTD|        4808|        4808|        7838|       0|        4767|       15191
RTD|        4767|        4808|        7272|       0|        4767|       15191
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4808|        4808|        7555|       0|        4767|       15191
RTD|        4767|        4808|        7959|       0|        4767|       15191
RTD|        4767|        4808|        7393|       0|        4767|       15191
RTD|        4808|        4808|        7191|       0|        4767|       15191
RTD|        4767|        4808|        7313|       0|        4767|       15191
Quoted 3 lines

Is this a bug or feature please? Can someone throw the light? Good would be to print the units to the numbers too (ns).

That was likely a layout question of the latency tool's output. We could simply dump something like "All latencies in nanoseconds" during start-up. Would this be more helpful?

Jan

------------------------------------------------------------------------

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.
#3 lore raw
Quoted 40 lines · Philippe Gerum
Quoted 38 lines · Jan Kiszka
Quoted 33 lines · Rudolf Marek

Hello all,

I tried the latency and klatency demo on some PPC procesor(s) (e500 and 60x) and the measurement results are rather strange. I observed this with arbitrary version of Adeos/ipipe and on Xenomai 2.0.3 older 2.0.x too.

-sh-3.00# ./run -- -T 10 -h -l 5
...

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4323|        5777|       0|       

-4525| 5777
RTD| -4525| -4444| -1777| 0|
-4525| 5777
RTD| -4525| -4444| -565| 0|
-4525| 5777
RTD| -4525| -4444| -1656| 0|
-4525| 5777
RTD| -4525| -4444| -1979| 0|
-4525| 5777

RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|       -4525|       -4444|       -2020|       0|       

-4525| 5777
RTD| -4525| -4444| -1050| 0|
-4525| 5777
RTD| -4525| -4444| -1616| 0|
-4525| 5777
RTD| -4525| -4444| -1898| 0|
-4525| 5777
RTD| -4525| -4444| -1939| 0|
-4525| 5777
...
Well if I set scheduling latency from automatic "0" to "1" I get:

Quoted 6 lines
Quoted 2 lines

0 means automatic latency compensation (which does not seem to work that well here, it overcompensates),

Dynamic determination of the intrinsic latency during nucleus startup has been dropped some time ago (circa fusion 0.6.8), because it just did not provide accurate results. Since then, when 0 is specified in Kconfig, the value read from include/asm-*/calibration.h is substituted. In this case, 9500 ns are taken for a ppc32 platform, which is likely too high for this board. Setting ~4500 in Kconfig would better approximate the latency.

Btw, the following would work too in order to easily test various settings dynamically:

$ echo 4500 > /proc/xenomai/latency
Quoted 45 lines

while 1 effectively means "no

Quoted 40 lines

hardware/software scheduling latency" (=> 1 ns). See also help of the related kernel configuration parameters.

Quoted 17 lines

-sh-3.00# ./run -- -T 10 -h -l 5

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4767|        4929|       15191|       0|        4767|       15191
RTD|        4767|        4808|        8282|       0|        4767|       15191
RTD|        4767|        4808|        8080|       0|        4767|       15191
RTD|        4808|        4808|        7838|       0|        4767|       15191
RTD|        4767|        4808|        7272|       0|        4767|       15191
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4808|        4808|        7555|       0|        4767|       15191
RTD|        4767|        4808|        7959|       0|        4767|       15191
RTD|        4767|        4808|        7393|       0|        4767|       15191
RTD|        4808|        4808|        7191|       0|        4767|       15191
RTD|        4767|        4808|        7313|       0|        4767|       15191
Quoted 3 lines

Is this a bug or feature please? Can someone throw the light? Good would be to print the units to the numbers too (ns).

That was likely a layout question of the latency tool's output. We could simply dump something like "All latencies in nanoseconds" during start-up. Would this be more helpful?

Jan

------------------------------------------------------------------------

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.
#4 lore raw
In reply to Jan Kiszka
Quoted 17 lines · Jan Kiszka
Quoted 16 lines · Rudolf Marek

...

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4767|        4929|       15191|       0|        4767|       15191
RTD|        4767|        4808|        8282|       0|        4767|       15191
RTD|        4767|        4808|        8080|       0|        4767|       15191
RTD|        4808|        4808|        7838|       0|        4767|       15191
RTD|        4767|        4808|        7272|       0|        4767|       15191
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4808|        4808|        7555|       0|        4767|       15191
RTD|        4767|        4808|        7959|       0|        4767|       15191
RTD|        4767|        4808|        7393|       0|        4767|       15191
RTD|        4808|        4808|        7191|       0|        4767|       15191
RTD|        4767|        4808|        7313|       0|        4767|       15191
Quoted 8 lines
Quoted 3 lines

Is this a bug or feature please? Can someone throw the light? Good would be to print the units to the numbers too (ns).

That was likely a layout question of the latency tool's output. We could simply dump something like "All latencies in nanoseconds" during start-up. Would this be more helpful?

The output of latency is indeed inconsistent. Histogram and stats are printed in microseconds, intermediate and overall latencies go out as nanoseconds. Anyone any objections to switch to micros with 3 digits after the decimal point? Patch is ready to be applied.

== Sampling period: 150 us
== Test mode: in-kernel timer handler
== All results in microseconds
warming up...

RTT|  00:00:01  (in-kernel timer handler, 150 us period)
RTH|-----lat min|-----lat avg|-----lat max|-overrun|----lat best|---lat

worst
RTD| 8.935| 13.824| 39.951| 0| 8.935|
39.951
RTD| 8.998| 14.619| 36.867| 0| 8.935|
39.951
RTD| 8.576| 14.604| 37.417| 0| 8.576|
39.951
RTD| 3.018| 14.623| 40.466| 0| 3.018|
40.466
[grabbed on a low-end board]

Jan

#5 lore raw
Quoted 30 lines · Jan Kiszka
Quoted 18 lines · Jan Kiszka
Quoted 16 lines · Rudolf Marek

...

RTT|  00:00:01
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4767|        4929|       15191|       0|        4767|       15191
RTD|        4767|        4808|        8282|       0|        4767|       15191
RTD|        4767|        4808|        8080|       0|        4767|       15191
RTD|        4808|        4808|        7838|       0|        4767|       15191
RTD|        4767|        4808|        7272|       0|        4767|       15191
RTT|  00:00:06
RTH|----klat min|----klat avg|----klat max| overrun|---klat best|--klat worst
RTD|        4808|        4808|        7555|       0|        4767|       15191
RTD|        4767|        4808|        7959|       0|        4767|       15191
RTD|        4767|        4808|        7393|       0|        4767|       15191
RTD|        4808|        4808|        7191|       0|        4767|       15191
RTD|        4767|        4808|        7313|       0|        4767|       15191
Quoted 8 lines
Quoted 3 lines

Is this a bug or feature please? Can someone throw the light? Good would be to print the units to the numbers too (ns).

That was likely a layout question of the latency tool's output. We could simply dump something like "All latencies in nanoseconds" during start-up. Would this be more helpful?

Quoted 4 lines

The output of latency is indeed inconsistent. Histogram and stats are printed in microseconds, intermediate and overall latencies go out as nanoseconds. Anyone any objections to switch to micros with 3 digits after the decimal point? Patch is ready to be applied.

Let's roll.

Quoted 28 lines

== Sampling period: 150 us
== Test mode: in-kernel timer handler
== All results in microseconds
warming up...

RTT|  00:00:01  (in-kernel timer handler, 150 us period)
RTH|-----lat min|-----lat avg|-----lat max|-overrun|----lat best|---lat

worst
RTD| 8.935| 13.824| 39.951| 0| 8.935|
39.951
RTD| 8.998| 14.619| 36.867| 0| 8.935|
39.951
RTD| 8.576| 14.604| 37.417| 0| 8.576|
39.951
RTD| 3.018| 14.623| 40.466| 0| 3.018|
40.466
[grabbed on a low-end board]

Jan

------------------------------------------------------------------------

_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Signature · 1 line
Philippe.