urandom solves latency issues ?

More
10 Oct 2013 07:33 - 10 Oct 2013 07:34 #39723 by 0x0539
Hello, I'm very new to EMC2, so new that I'm currently on the process of selecting the best hardware I have at home to run it.
I'm now testing a HP 5700 SFF based on ICH8, I have installed EMC2 to the local hard drive using the official linuxcnc 10.04 LTS media, kernel options are stock (no isolcpus nor noirqblanace and such) although I've disabled some devices at BIOS but it seems not to make a difference.

Starting multiple instances of glxgears and loading the CPU to 100% produces a max jitter of 61174 and 20460 ns.

If I open a terminal and type:
# cat /dev/urandom > /dev/null

Now running the latency test again (with all the same stuff as before) I get the following figures: 4148 and 3363 ns.

Should I trust this figures ? And if so what's going on ?
Last edit: 10 Oct 2013 07:34 by 0x0539.

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

More
10 Oct 2013 15:14 - 10 Oct 2013 15:15 #39726 by ArcEye

If I open a terminal and type:
# cat /dev/urandom > /dev/null

Now running the latency test again (with all the same stuff as before) I get the following figures: 4148 and 3363 ns.

Should I trust this figures ? And if so what's going on ?


You are creating a high CPU load, a cpu hog
See my FAQ for an explanation
www.linuxcnc.org/index.php/english/forum...me-latency-solutions

Does suggest that you really ought to be running with the isolcpus kernel parameter to isolate all bar one kernel
Looks like a dual core so you would need isolcpus=1

The ICH_8 Rev 04 chip has the SMI problem also discussed in that FAQ.
It appears to be only that revision and if you are getting 20K with no spikes normally, you can discount that most likely.
Do a lspci -vv (2 x v not w) to see the exact chip details to be sure.


regards
Last edit: 10 Oct 2013 15:15 by ArcEye.
The following user(s) said Thank You: 0x0539

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

More
10 Oct 2013 19:49 - 10 Oct 2013 21:49 #39734 by 0x0539
I think I was lucky: Intel Corp 82801H (ICH8 family) (rev 02)

Running with isolcpus=1 I get the following figures:
Max interval - servo(1ms) 1057259, base(25us) 45724
Max jitter - servo(1ms) 61540, base(25us) 20822

Issuing cat /dev/urandom with isolcpus=1
Max interval - servo(1ms) 998739, base(25us) 30367
Max jitter - servo(1ms) 2736, base(25us) 5465

Does this mean that I should have a loop() running on the background when running EMC2 ?
Last edit: 10 Oct 2013 21:49 by 0x0539.

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

More
10 Oct 2013 22:45 - 10 Oct 2013 22:46 #39738 by ArcEye
It is not ideal, but it could come to that, at least you can script it the be spawned after linuxcnc has started.

I would have a play with kernel parameters, nohalt and noirqbalance in particular.
www.kernel.org/doc/Documentation/kernel-parameters.txt

nohalt had a profound effect on some computers when we were testing early xenomai realtime kernels.
I have run noirqbalance and proved that it pushes all the interrupts across to core 0

Also see this thread
www.linuxcnc.org/index.php/english/forum...ulticore-pcs-success

I was not able to get any improvement from it but spainman and anders seemed to

I don't know if Intel still has hyperthreading on those chips, but that and any intelligent fan control definately needs to be off.

good luck
Last edit: 10 Oct 2013 22:46 by ArcEye.
The following user(s) said Thank You: 0x0539

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

More
11 Oct 2013 06:10 #39751 by 0x0539
It's a no go, I've tried all the options you suggested plus all the info on that thread, jitter will never go down 20k ns unless I do a loop, even works with cat /dev/zero.

The processor is a Core 2, and as I only see two CPU I assume no HT.

My option will be to run the loop before starting milling ?

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

More
11 Oct 2013 13:20 #39759 by ArcEye
If you are using software generated pulses for steppers, you may have to.

If you have a hardware step generator or are using servos, it does not matter, you probably would not have a base thread.

I would try using it as it is to start with.
20K heavily loaded is not unworkable, it will be what plenty of people have.
If you cannot get the velocity and acceleration you want without realtime errors, with the base thread set accordingly, you may have to try the cpu hog.

Nothing is free however, the userspace programs will be affected and run slowly, only getting processor time when the rt priority allows

regards
The following user(s) said Thank You: 0x0539

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

More
11 Oct 2013 19:50 #39766 by 0x0539
Thanks for the advice.
What I find strange is that when I run the hog it's unnoticeable the performance impact, glxgears runs fine and you're able to open programs and use the computer without any noticeable impact.

Maybe it's a bit offtopic, I used Gentoo for a lot of time in the past then my spare time ran out and I had to switch to package based systems.
I'm used to compile my own kernel but I never did it for rt, what should I have in mind if I want to build my own kernel for this machine ? Will it improve the performance ?

As 10.04 LTS ran out of support period I was planning to install the latest LTS and compile the rt kernel for it.

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

More
11 Oct 2013 22:14 #39769 by ArcEye

I'm used to compile my own kernel but I never did it for rt, what should I have in mind if I want to build my own kernel for this machine ? Will it improve the performance ?
As 10.04 LTS ran out of support period I was planning to install the latest LTS and compile the rt kernel for it.


It will do a bit at least because you can tailor it to the processor instruction set, number of cores etc and be more radical in turning off all powersaving, hibernation etc etc.

I am running my own 3.5.7-rtai kernel on Debian 7.1 (Wheezy) at present and have also built a 3.8.0-rtai kernel targetted specifically at Intel Atom
They are here www.mgware.co.uk/ accessible from the drop down menu on the left hand side.

This kernel runs 20% better latency than the generic 3.5.7-rtai
here highlab.com/~seb/linuxcnc/rtai-for-3.5-prerelease/ on this machine

I would advise Debian rather than use Ubuntu 12.04, which is fast becoming wannabe windoze 8 bloatware, but that may be my personal prejudice B)

At present 3.5.7 and 3.8 are the only 2 late kernels for which rtai patches exist

If you want to give it a go, PM me and I can send you a basic kernel .config and realtime config as a starting point plus some git and cvs urls

regards

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

More
11 Oct 2013 23:59 #39777 by 0x0539
I use xfce on most of my machines running Ubuntu, Unity is well.. let's not go further offtopic. :-)
Do the target system for the custom rtai kernel needs to be i386 or could it be amd64 ?

If you could provide more info it would be very welcome. I'm sorry not to send you a PM but this forum template is not the best one IMHO, at least I was unable to find the correct button to do it.

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

More
12 Oct 2013 14:40 #39795 by ArcEye

I'm sorry not to send you a PM but this forum template is not the best one IMHO, at least I was unable to find the correct button to do it.


Just click on my avatar or name in the field next to a post from me and you will go to my profile, then click on Messages > Send email

Do the target system for the custom rtai kernel needs to be i386 or could it be amd64 ?


It is possible to build 64 bit rtai kernels, but the patches were some way behind 32 bit last time I looked so older kernels only
You can build 64 bit realtime too, but since Linuxcnc is 32 bit there is no point.

Someone did build a 64 bit version of Linuxcnc some while back, but I have not heard anything about it for some time.
It will be a fixed version and quite dated by now with all the development recently.

regards

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

Time to create page: 0.078 seconds
Powered by Kunena Forum