[LITMUS^RT] Running LITMUS-RT on ARM64

Andrii Anisov andrii_anisov at epam.com
Wed Sep 6 14:03:06 CEST 2017


Hello Björn,


On 06.09.17 02:23, Björn Brandenburg wrote:
> The last one ("Avoid a double to integer casting error") I don’t yet fully understand; I left a comment on GitHub.
I knew it, so have it separated. The issue was
The issue is in <double> representation, it looks like IEEE 754 is not 
strictly followed on my setup. Not sure about the rootcause (it is 
hardware or compiler issue).
Anyway, with the patch [1], I have following:

     root at genericarmv8:~# ./rtspin -l -a 195000
     Evaluating loop with 195000 cycles:
         exec_time = 5.0000000000000000e-01
         exec_time_ms = 5.0000000000000000e+02
         count_ms = 500
     0.5000s: looped for 0.50220045s, delta= 0.00220045s, error= 0.4401%
         exec_time = 4.8999999999999999e-01
         exec_time_ms = 4.9000000000000000e+02
         count_ms = 490
     0.4900s: looped for 0.49238345s, delta= 0.00238345s, error= 0.4864%
         exec_time = 4.7999999999999998e-01
         exec_time_ms = 4.8000000000000000e+02
         count_ms = 480
     0.4800s: looped for 0.48237241s, delta= 0.00237241s, error= 0.4943%
         exec_time = 4.6999999999999997e-01
         exec_time_ms = 4.7000000000000000e+02
         count_ms = 470
     0.4700s: looped for 0.47239845s, delta= 0.00239845s, error= 0.5103%
         exec_time = 4.5999999999999996e-01
         exec_time_ms = 4.5999999999999994e+02
         count_ms = 459
     0.4600s: looped for 0.46130080s, delta= 0.00130080s, error= 0.2828%
         exec_time = 4.4999999999999996e-01
         exec_time_ms = 4.4999999999999994e+02
         count_ms = 449
     0.4500s: looped for 0.45125892s, delta= 0.00125892s, error= 0.2798%
         exec_time = 4.3999999999999995e-01
         exec_time_ms = 4.3999999999999994e+02
         count_ms = 439
     0.4400s: looped for 0.44101700s, delta= 0.00101700s, error= 0.2311%
         exec_time = 4.2999999999999994e-01
         exec_time_ms = 4.2999999999999994e+02
         count_ms = 429
     0.4300s: looped for 0.43110221s, delta= 0.00110221s, error= 0.2563%
         exec_time = 4.1999999999999993e-01
         exec_time_ms = 4.1999999999999994e+02
         count_ms = 419
     0.4200s: looped for 0.42096948s, delta= 0.00096948s, error= 0.2308%
         exec_time = 4.0999999999999992e-01
         exec_time_ms = 4.0999999999999994e+02
         count_ms = 409
     0.4100s: looped for 0.41105192s, delta= 0.00105192s, error= 0.2566%
         exec_time = 3.9999999999999991e-01
         exec_time_ms = 3.9999999999999989e+02
         count_ms = 399
     0.4000s: looped for 0.40095724s, delta= 0.00095724s, error= 0.2393%
         exec_time = 3.8999999999999990e-01
         exec_time_ms = 3.8999999999999989e+02
         count_ms = 389
     0.3900s: looped for 0.39092052s, delta= 0.00092052s, error= 0.2360%
         exec_time = 3.7999999999999989e-01
         exec_time_ms = 3.7999999999999989e+02
         count_ms = 379
     0.3800s: looped for 0.38087240s, delta= 0.00087240s, error= 0.2296%
         exec_time = 3.6999999999999988e-01
         exec_time_ms = 3.6999999999999989e+02
         count_ms = 369
     0.3700s: looped for 0.37078744s, delta= 0.00078744s, error= 0.2128%
         exec_time = 3.5999999999999988e-01
         exec_time_ms = 3.5999999999999989e+02
         count_ms = 359
     0.3600s: looped for 0.36076560s, delta= 0.00076560s, error= 0.2127%
         exec_time = 3.4999999999999987e-01
         exec_time_ms = 3.4999999999999989e+02
         count_ms = 349
     0.3500s: looped for 0.35067332s, delta= 0.00067332s, error= 0.1924%
         exec_time = 3.3999999999999986e-01
         exec_time_ms = 3.3999999999999989e+02
         count_ms = 339
     0.3400s: looped for 0.34066480s, delta= 0.00066480s, error= 0.1955%
         exec_time = 3.2999999999999985e-01
         exec_time_ms = 3.2999999999999983e+02
         count_ms = 329
     0.3300s: looped for 0.33058332s, delta= 0.00058332s, error= 0.1768%
         exec_time = 3.1999999999999984e-01
         exec_time_ms = 3.1999999999999983e+02
         count_ms = 319
     0.3200s: looped for 0.32053124s, delta= 0.00053124s, error= 0.1660%
         exec_time = 3.0999999999999983e-01
         exec_time_ms = 3.0999999999999983e+02
         count_ms = 309
     0.3100s: looped for 0.31048132s, delta= 0.00048132s, error= 0.1553%
         exec_time = 2.9999999999999982e-01
         exec_time_ms = 2.9999999999999983e+02
         count_ms = 299
     0.3000s: looped for 0.30041028s, delta= 0.00041028s, error= 0.1368%
         exec_time = 2.8999999999999981e-01
         exec_time_ms = 2.8999999999999983e+02
         count_ms = 289
     0.2900s: looped for 0.29055464s, delta= 0.00055464s, error= 0.1913%
         exec_time = 2.7999999999999980e-01
         exec_time_ms = 2.7999999999999983e+02
         count_ms = 279
     0.2800s: looped for 0.28039816s, delta= 0.00039816s, error= 0.1422%
         exec_time = 2.6999999999999980e-01
         exec_time_ms = 2.6999999999999977e+02
         count_ms = 269
     0.2700s: looped for 0.27032172s, delta= 0.00032172s, error= 0.1192%
         exec_time = 2.5999999999999979e-01
         exec_time_ms = 2.5999999999999977e+02
         count_ms = 259
     0.2600s: looped for 0.26016944s, delta= 0.00016944s, error= 0.0652%
         exec_time = 2.4999999999999978e-01
         exec_time_ms = 2.4999999999999977e+02
         count_ms = 249
     0.2500s: looped for 0.25021828s, delta= 0.00021828s, error= 0.0873%
         exec_time = 2.3999999999999977e-01
         exec_time_ms = 2.3999999999999977e+02
         count_ms = 239
     0.2400s: looped for 0.24017484s, delta= 0.00017484s, error= 0.0729%
         exec_time = 2.2999999999999976e-01
         exec_time_ms = 2.2999999999999977e+02
         count_ms = 229
     0.2300s: looped for 0.23012768s, delta= 0.00012768s, error= 0.0555%
         exec_time = 2.1999999999999975e-01
         exec_time_ms = 2.1999999999999974e+02
         count_ms = 219
     0.2200s: looped for 0.22012288s, delta= 0.00012288s, error= 0.0559%
         exec_time = 2.0999999999999974e-01
         exec_time_ms = 2.0999999999999974e+02
         count_ms = 209
     0.2100s: looped for 0.21011892s, delta= 0.00011892s, error= 0.0566%
         exec_time = 1.9999999999999973e-01
         exec_time_ms = 1.9999999999999974e+02
         count_ms = 199
     0.2000s: looped for 0.20003456s, delta= 0.00003456s, error= 0.0173%
         exec_time = 1.8999999999999972e-01
         exec_time_ms = 1.8999999999999972e+02
         count_ms = 189
     0.1900s: looped for 0.18992116s, delta=-0.00007884s, error=-0.0415%
         exec_time = 1.7999999999999972e-01
         exec_time_ms = 1.7999999999999972e+02
         count_ms = 179
     0.1800s: looped for 0.17985744s, delta=-0.00014256s, error=-0.0792%
         exec_time = 1.6999999999999971e-01
         exec_time_ms = 1.6999999999999972e+02
         count_ms = 169
     0.1700s: looped for 0.16991660s, delta=-0.00008340s, error=-0.0491%
         exec_time = 1.5999999999999970e-01
         exec_time_ms = 1.5999999999999969e+02
         count_ms = 159
     0.1600s: looped for 0.15984148s, delta=-0.00015852s, error=-0.0991%
         exec_time = 1.4999999999999969e-01
         exec_time_ms = 1.4999999999999969e+02
         count_ms = 149
     0.1500s: looped for 0.14979588s, delta=-0.00020412s, error=-0.1361%
         exec_time = 1.3999999999999968e-01
         exec_time_ms = 1.3999999999999969e+02
         count_ms = 139
     0.1400s: looped for 0.13971632s, delta=-0.00028368s, error=-0.2026%
         exec_time = 1.2999999999999967e-01
         exec_time_ms = 1.2999999999999966e+02
         count_ms = 129
     0.1300s: looped for 0.12961804s, delta=-0.00038196s, error=-0.2938%
         exec_time = 1.1999999999999968e-01
         exec_time_ms = 1.1999999999999967e+02
         count_ms = 119
     0.1200s: looped for 0.11959272s, delta=-0.00040728s, error=-0.3394%
         exec_time = 1.0999999999999968e-01
         exec_time_ms = 1.0999999999999969e+02
         count_ms = 109
     0.1100s: looped for 0.10955612s, delta=-0.00044388s, error=-0.4035%
         exec_time = 9.9999999999999686e-02
         exec_time_ms = 9.9999999999999687e+01
         count_ms = 99
     0.1000s: looped for 0.09945208s, delta=-0.00054792s, error=-0.5479%
         exec_time = 8.9999999999999691e-02
         exec_time_ms = 8.9999999999999687e+01
         count_ms = 89
     0.0900s: looped for 0.08950728s, delta=-0.00049272s, error=-0.5475%
         exec_time = 7.9999999999999696e-02
         exec_time_ms = 7.9999999999999702e+01
         count_ms = 79
     0.0800s: looped for 0.07941056s, delta=-0.00058944s, error=-0.7368%
         exec_time = 6.9999999999999701e-02
         exec_time_ms = 6.9999999999999702e+01
         count_ms = 69
     0.0700s: looped for 0.06937036s, delta=-0.00062964s, error=-0.8995%
         exec_time = 5.9999999999999699e-02
         exec_time_ms = 5.9999999999999702e+01
         count_ms = 59
     0.0600s: looped for 0.05929848s, delta=-0.00070152s, error=-1.1692%
         exec_time = 4.9999999999999697e-02
         exec_time_ms = 4.9999999999999694e+01
         count_ms = 49
     0.0500s: looped for 0.04923632s, delta=-0.00076368s, error=-1.5274%
         exec_time = 3.9999999999999696e-02
         exec_time_ms = 3.9999999999999694e+01
         count_ms = 39
     0.0400s: looped for 0.03925036s, delta=-0.00074964s, error=-1.8741%
         exec_time = 2.9999999999999694e-02
         exec_time_ms = 2.9999999999999694e+01
         count_ms = 29
     0.0300s: looped for 0.02916276s, delta=-0.00083724s, error=-2.7908%
         exec_time = 1.9999999999999692e-02
         exec_time_ms = 1.9999999999999691e+01
         count_ms = 19
     0.0200s: looped for 0.01912592s, delta=-0.00087408s, error=-4.3704%

You can see that on my setup, i.e. 0.02d, is presented with value 
smaller that expected, while IEEE754 requires it to be bigger, like [2].
So as a solution I used [3] for a round up to the nearest bigger integer.

[1] 
https://github.com/aanisov/liblitmus/commit/759700c63fbf03c4e0e4f897e7b13c46db770283
[2] http://www.binaryconvert.com/result_double.html?decimal=048046048050
[3] 
https://github.com/LITMUS-RT/liblitmus/pull/3/commits/ff9fd248b61e6004eb39e95f504d9c3f9c7aac74

-- 

*Andrii Anisov*





More information about the litmus-dev mailing list