Reducing latency on multicore pc's - Success!

More
28 Aug 2013 15:04 #38181 by ArcEye
Sounds promising

Don't forget anyone reporting results to put the full results on the wiki

wiki.linuxcnc.org/cgi-bin/wiki.pl?Latency-Test

Go to the 5th line down and a link called Basic Steps to see how to sign in to edit pages

Please Log in or Create an account to join the conversation.

More
29 Aug 2013 22:31 #38225 by green751
I've added mine.

Although, interestingly enough, I have even "better?" results now.

As mentioned, I wanted to try a fast servo loop because I'm hoping to try out software commutation of my brushless servos.

So I tried another couple of tweaks to my machine configuration, and not finding anything that helped any more than the above listed scripts and IRQ reassignment, I gave a latency test with a fast servo loop a try:

# latency-test 25us 125us

... then I ran my "exercise" script, which starts up a few copies of glxgears and also runs totem playing a full motion video file (an example ogg theora clip from the mplayer site) in a continuous loop.

I'll check on it tonight when I get home (I like to run 24 hour tests), but so far it seems both threads have jitter around 2000. (not 20,000, *2000* ns).

I'm guessing this is because the shorter period on the servo thread means the thread code stays in the processor cache all the time? Has anyone else seen or tried this?

Thanks,
Erik

Please Log in or Create an account to join the conversation.

More
30 Aug 2013 04:58 - 30 Aug 2013 04:59 #38229 by green751
Final numbers after 24 hours for the above mentioned 25us/125us run:


126322 2803
27122 2298

Erik
Last edit: 30 Aug 2013 04:59 by green751. Reason: typo

Please Log in or Create an account to join the conversation.

More
01 Jan 2014 01:51 #42239 by kivig
Thanks!
Had about 35000, now it shows jittering of 3500.
Though if I put max jittering anywhere lower than 12000 it glitches (while accelerating speed goes up, then it starts to go down), but still - 12000 is much much better :)
Btw - is it normal that launch of any aplication produces enormous lag.. like 350000 and more? Any other sort of abuse doesn't do that.

Please Log in or Create an account to join the conversation.

More
01 Jan 2014 02:41 #42243 by green751
Sure.

PC Hard disks are quite a bit slower than memory, and depending on the hardware involved in controlling them there may be a big burst of lag when you access them, like when any program starts.

Possible sources of delay include slow I/O hardware, disk controllers on the other side of a slow bus, a slow disk or a disk in a slow access mode (3 Gb instead of 6 Gb SATA, for instance) or even a failing hard disk that's generating errors.

You can test whether the disk is the problem by moving your program somewhere else to run it, like a RAMdisk if you have enough memory.

Please Log in or Create an account to join the conversation.

More
01 Jan 2014 22:28 #42265 by kivig

Sure.

PC Hard disks are quite a bit slower than memory, and depending on the hardware involved in controlling them there may be a big burst of lag when you access them, like when any program starts.

Possible sources of delay include slow I/O hardware, disk controllers on the other side of a slow bus, a slow disk or a disk in a slow access mode (3 Gb instead of 6 Gb SATA, for instance) or even a failing hard disk that's generating errors.

You can test whether the disk is the problem by moving your program somewhere else to run it, like a RAMdisk if you have enough memory.

Thanks, will check that. Didn't thought hdd might be a "blocking function".
Happy new year!

Please Log in or Create an account to join the conversation.

  • qthree
  • qthree's Avatar
  • Visitor
  • Visitor
09 Aug 2014 19:13 - 09 Aug 2014 19:13 #49619 by qthree
What about Debian 7 with linuxcnc 2.6.1? I installed it from binary.hybrid.iso and same method doesn't work, still 8000ns to 10000ns
Ubuntu 10.04 works well: 1300ns to 4800ns
Last edit: 09 Aug 2014 19:13 by qthree.

Please Log in or Create an account to join the conversation.

More
18 Mar 2015 01:56 #56957 by Doc Alex
Hello

I am completely new to this.

I managed everything of this description except the grub modification:

The Max Jitters are down to 4764 (1ms) and 8522 (25ms).

I use the standard configuration of linux CNC including debian linux.

I added the following two lines to grub

isolcpus=1
acpi_irq_nobalance noirqbalance

I tried to call update-grub afterwards. I receive the error message that update-grub cannot be found.
therefore I called it directly:

sudo /usr/sbin/update-grub

the response is:

/usr/sbin/grub-mkonfig:35/etc/default/grub: acpi_irq_nobalance not found.

What do I do wrong?

Furthermore the provided debian version has no software center. How do i figure out if irqbalance is running?
best wishes

Doc Alex.

Please Log in or Create an account to join the conversation.

More
28 Nov 2015 11:43 - 29 Nov 2015 17:24 #65930 by steinbeisser
I tried Spainman's scripts on my machine and they seem to improve my latency.

My machine:
Club3D ATI Radeon X300 256MB PCI-E Silent
Gigabyte GA-P35-DS4 rev1.0
Intel Core2Duo E8400
4x1GB Ram
WD IDE HDD

BIOS settings:
All peripherals set to OFF, except LAN and LPT
Every setting that seems to alter the clock for power saving or performance: OFF

Kernel parameters copied from Spainman's first post in this thread:
"isolcpus=1 acpi_irq_nobalance noirqbalance"

In the attached picture, you can see
- latency-plot
- 3x gxlgears
- 1080p Big Buck Bunny

It seems like the upstart script provided by Spainman doesn't work with debian, so i called his set-irq-affinity script manually.
In the plot, i highlighted the point in time when i called "set-irq-affinity 1"
As you can see the latency spikes are reduced after this.



Edit:
It seems like i was a bit lucky taking this screenshot. It is true, that setting irq-affinity 1 calms down the small spikes, but sadly the huge spikes of ~17k are still happening, even with irq-affinity 1.
Attachments:
Last edit: 29 Nov 2015 17:24 by steinbeisser.

Please Log in or Create an account to join the conversation.

More
28 Nov 2015 11:47 - 28 Nov 2015 12:50 #65931 by steinbeisser
@Doc Alex:

I added the following two lines to grub

isolcpus=1
acpi_irq_nobalance noirqbalance


I think this has to be one line. you have to add it to the line you already have.
For example:
GRUB_CMDLINE_LINUX_DEFAULT="isolcpus=1 acpi_irq_nobalance noirqbalance lapic quiet rootdelay=5"

@qthree:
The reason might be, that the upstart script doesn't work on debian (at least it doesn't work on my machine)
I have no idea how this upstart stuff works, so i hope someone here can help us with this :)
Last edit: 28 Nov 2015 12:50 by steinbeisser.

Please Log in or Create an account to join the conversation.

Time to create page: 0.148 seconds
Powered by Kunena Forum