Skip to contentSkip to conversation

Non-Preempt Test v1.01

DISCUSSION Raphaël Beamonte 2 participants 4 messages Oct 14, 2013 – Oct 16, 2013

lore
Share & tools
lore
#0 lore raw

Hi all !

I just released the Non-Preempt Test (npt) version 1.01 which is available here: http://git.dorsal.polymtl.ca/?p=npt.git

The purpose of this tool is to simulate a small real-time system that runs with a high priority without being stopped or preempted. To do so, it first sets its environment (cpu affinity, RT scheduler, memory locked into RAM with mlockall) and can optionally disable the local IRQs if compiled with the right options (not defined by default).

The core of the application is a loop that calculates the time gap between the start of two consecutive loops using the rdtsc asm instruction, thus a similarity with the hwlat_detector kernel module for kernel analysis. At the end of its execution, npt computes latencies statistics for each loop and generates a histogram showing the different latencies reached and the number of time it reached each one.

This tool can be used to analyse and identify overhead of different realtime applications as we can compare the latencies in each loops and thus identify the added latency from a "blank" run. It is released LTTng-ready and can thus be easily traced. Next versions could include other userspace tracers ability.

Feedback, collaborations and contributions are welcome!

Regards,
Raphaël Beamonte

#1 lore raw

Thanks for sharing this, will check it out if I get a chance. Do you have a http git url that I can clone? I'm behind a firewall.

Quoted 24 lines · Raphaël Beamonte

Hi all !

I just released the Non-Preempt Test (npt) version 1.01 which is available here: http://git.dorsal.polymtl.ca/?p=npt.git

The purpose of this tool is to simulate a small real-time system that runs with a high priority without being stopped or preempted. To do so, it first sets its environment (cpu affinity, RT scheduler, memory locked into RAM with mlockall) and can optionally disable the local IRQs if compiled with the right options (not defined by default).

The core of the application is a loop that calculates the time gap between the start of two consecutive loops using the rdtsc asm instruction, thus a similarity with the hwlat_detector kernel module for kernel analysis. At the end of its execution, npt computes latencies statistics for each loop and generates a histogram showing the different latencies reached and the number of time it reached each one.

This tool can be used to analyse and identify overhead of different realtime applications as we can compare the latencies in each loops and thus identify the added latency from a "blank" run. It is released LTTng-ready and can thus be easily traced. Next versions could include other userspace tracers ability.

Quoted 5 lines

Feedback, collaborations and contributions are welcome!

Regards,
Raphaël Beamonte

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 2 lines · Aaron Fabbri

Thanks for sharing this, will check it out if I get a chance. Do you have a http git url that I can clone? I'm behind a firewall.

Hello Aaron,

Thanks for your interest!
It is now possible to clone the repository using http:
git clone http://git.dorsal.polymtl.ca/git/npt.git

Regards,
Raphaël
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Cool. Just FYI, did a quick run on two machines and got sane results (maximums near what I'd expect). First is generic kernel, second is -RT w/ NO_HZ_FULL & CPU isolation.

1. Desktop (Ivy Bridge , default 3.8.0-31-generic ubuntu 13 kernel)

$ sudo ./npt -n 100 -l 5234567890 -p 80 -e
# CPU affinity set on CPU 1
# Application priority set to 80
# CPU frequency (evaluation): 2594.10 MHz
# Running for 5234567890 loops.. Please wait.
5234567890 loops done.
Loops duration:
        min:            0.004626 us
        max:            303.812622 us
        mean:           0.031345 us
        sum:            164075829.870756 us
        variance:       0.00079042 us
        std dev:        0.028114 us
--------------------------
duration (us)   nb. loops
--------------------------
0               5234494969
1               3629
2               8119
3               15105
4               4112
5               5200
6               1013
7               2176
8               29702
9               1929
10              910
11              309
12              241
13              179
14              47
15              23
16              26
17              22
18              13
19              18
20              31
21              48
22              20
23              6
24              3
25              5
26              3
27              4
28              2
29              4
30              2
31              4
32              2
33              2
34              5
35              1
36              1
39              1
41              1
48              1
56              1
303             1
--------------------------
Overruns (1000000+): 0

2. Server (3.10.10-rt7, isolcpus / NO_HZ_FULL / rcu thread offloading / ftrace built, not enabled)

$ sudo ./npt -n 100 -a 10 -l 5234567890 -p80
# CPU affinity set on CPU 10
# Application priority set to 80
# CPU frequency (/proc/cpuinfo): 1995.18 MHz
# Running for 5234567890 loops.. Please wait.
5234567890 loops done.
Loops duration:
        min:            0.014034 us
        max:            31.275311 us
        mean:           0.024035 us
        sum:            125811537.493472 us
        variance:       0.000198279 us
        std dev:        0.014081 us
--------------------------
duration (us)   nb. loops
--------------------------
0               5234536424
1               9870
2               7926
3               2048
4               200
5               30
6               22
7               1491
8               8666
9               307
10              330
11              31
12              1
14              5
15              19
16              103
17              308
18              11
22              7
23              25
24              63
25              1
31              2
--------------------------
Overruns (1000000+): 0

To generate a little load I just did this during both tests:

$ sudo find / -type f -exec md5sum "{}" \; > /dev/null 2>&1

As well as

$ sudo ping -i 0.001 localhost
Quoted 4 lines · Raphaël Beamonte
Quoted 2 lines · Aaron Fabbri

Thanks for sharing this, will check it out if I get a chance. Do you have a http git url that I can clone? I'm behind a firewall.

Quoted 8 lines

Hello Aaron,

Thanks for your interest!
It is now possible to clone the repository using http:
git clone http://git.dorsal.polymtl.ca/git/npt.git

Regards,
Raphaël

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html