cyclictest

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

There's a new RT kernel 4.19.13-rt10-1-rt available and I tested it. The trend of gradual improvement is continuing.
4.19.13-rt10-1-rt #1 SMP PREEMPT RT.png
4.19.13-rt10-1-rt #1 SMP PREEMPT RT.png (7.58 KiB) Viewed 1829 times
Again there's one rebellious core. :)
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

And a new low latency kernel came out: 4.20.1-arch1-1-ARCH. Comparing this plot to the previous one shows the difference between low latency (this) and real time (previous).
4.20.1-arch1-1-ARCH #1 SMP PREEMPT.png
4.20.1-arch1-1-ARCH #1 SMP PREEMPT.png (8.74 KiB) Viewed 1823 times
gimmeapill
Established Member
Posts: 564
Joined: Thu Mar 12, 2015 8:41 am
Has thanked: 44 times
Been thanked: 8 times

Re: cyclictest

Post by gimmeapill »

Interesting results. Even at 540 us worst case latency the stock kernel does quite ok'ish for audio.
Regarding those RT results with one core acting up: did you try to run the RT cyclictest with 3 cores?
I'm wondering if sacrificing one core wouldn't actually help.
It could be also a matter of RT priorities stepping on each other's toes. Do you have something like rtirq enabled?
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

gimmeapill wrote:It could be also a matter of RT priorities stepping on each other's toes. Do you have something like rtirq enabled?
I do. rtirq behaves differently on Arch from on KXstudio. I have set RTIRQ_RESET_ALL=1 on both systems. On Arch I get this:

Code: Select all

★ /usr/bin/rtirq status

  PID CLS RTPRIO  NI PRI %CPU STAT COMMAND	
  353 FF      95   - 135  0.0 S    irq/20-snd_ice1	
   61 FF      50   -  90  0.0 S    irq/9-acpi	
  115 FF      50   -  90  0.0 S    irq/8-rtc0	
  176 FF      50   -  90  0.0 S    irq/17-ehci_hcd	
  188 FF      50   -  90  0.0 S    irq/19-ehci_hcd	
  189 FF      50   -  90  0.0 S    irq/14-pata_ati	
  190 FF      50   -  90  0.0 S    irq/15-pata_ati	
  194 FF      50   -  90  0.0 S    irq/24-ahci[000	
  206 FF      50   -  90  0.0 S    irq/16-ohci_hcd	
  222 FF      50   -  90  0.0 S    irq/16-ohci_hcd	
  223 FF      50   -  90  0.0 S    irq/18-ohci_hcd	
  224 FF      50   -  90  0.0 S    irq/18-ohci_hcd	
  225 FF      50   -  90  0.0 S    irq/18-ohci_hcd	
  349 FF      50   -  90  0.0 S    irq/19-snd_hda_	
  360 FF      50   -  90  0.0 S    irq/18-radeon	
  383 FF      50   -  90  0.0 S    irq/25-enp2s0	
    9 TS       -   0  19  0.0 S    ksoftirqd/0	
   27 TS       -   0  19  0.0 S    ksoftirqd/1	
   36 TS       -   0  19  0.0 S    ksoftirqd/2	
   45 TS       -   0  19  0.0 S    ksoftirqd/3	
On KX no irqs except the soundcard are on scheduler FF.

I've found that I only get a rogue core when JACK is started. That would make sense as both JACK and cyclictest have a high priority.
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

I ran mklatencyplot.bash again without JACK, and got this:
4.19.13-rt10-1-rt #1 SMP PREEMPT RT No JACK.png
4.19.13-rt10-1-rt #1 SMP PREEMPT RT No JACK.png (7.28 KiB) Viewed 1804 times
That's a very low maximum latency. One core having a higher maximum latency than the others was due to JACK. I don't think the previous plots show a problem, because the maximum latency is still under the recommended 100us, even with hackbench running and two high priority threads (JACK and cyclictest) competing for a core. In normal audio use JACK wouldn't have to compete with other high priority threads like those used by cyclictest.
pawan4749
Established Member
Posts: 5
Joined: Wed Mar 06, 2019 1:56 am

Re: cyclictest

Post by pawan4749 »

# 8. Execute plot command
gnuplot -persist <plotcmd

I'm running the cyclictest but getting error as:
gnuplot: command not found

Any help please to overcome this.
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

Hi pawan4749. You need to install gnuplot. On ubuntu this would be

Code: Select all

sudo apt-get install gnuplot
pawan4749
Established Member
Posts: 5
Joined: Wed Mar 06, 2019 1:56 am

Re: cyclictest

Post by pawan4749 »

Hi Merlyn,
Thanks for your suggestion.
Im running cyclictest on rt-kernel image of 4.14.
sudo apt-get install gnuplot command is not working.
Results:
apt-get: Command not found
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

What distro are you using?
pawan4749
Established Member
Posts: 5
Joined: Wed Mar 06, 2019 1:56 am

Re: cyclictest

Post by pawan4749 »

I'm using poky (Yocto)
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

OK, that's a distro aimed at embedded systems? I'm not familiar with it. You managed to install rt-tests. Or did that come with the distro?

However you install software on your distro, use that method to install gnuplot. You may have to download the gnuplot source and compile it.
pawan4749
Established Member
Posts: 5
Joined: Wed Mar 06, 2019 1:56 am

Re: cyclictest

Post by pawan4749 »

Hi
I have created python script for the cyclictest command "cyclictest -l100000000 -m -Sp90 -i200 -h100000000" and running on target through remotely (using ssh). But, it is taking abnormal time around 13 hrs, 15 hrs.
can any one please suggest what can be the reason(do executing script through ssh may have any effect).
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

I'm using :

Code: Select all

cyclictest -l100000000 -m -Sp90 -i200 -h400 -q 
Why are you using a large value for -h?
pawan4749
Established Member
Posts: 5
Joined: Wed Mar 06, 2019 1:56 am

Re: cyclictest

Post by pawan4749 »

As I'm using -l loops as 100 million , so for histograms also using100 million
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: cyclictest

Post by merlyn »

That could be the problem. From the cyclictest manpage :

Code: Select all

 -h, --histogram=US
              Dump  latency  histogram to stdout after the run. US is the max
              latency time to be be tracked in microseconds. This option runs
              all threads at the same priority.
100000000 microseconds is 100 seconds.
Post Reply