Howto schedule realtime tasks to CPU1 when isolcpus=1
as I mentioned in my other thread I installed LinuxCNC on Lubunut. I am now down to a max latency of 13000, which seems ok to me for a start. The PC is an Athlon64 X2 (dual core)
However I noticed one thing:
All threads are on CPU0 when I use the isolcpus=1 parameter. Nothing is on CPU1.
Wouldn't it make sense to run the realtime threads on the CPU1?
Is this possible?
Thanks
Domca
Please Log in or Create an account to join the conversation.
However I noticed one thing:
All threads are on CPU0 when I use the isolcpus=1 parameter. Nothing is on CPU1.
Wouldn't it make sense to run the realtime threads on the CPU1?
I can only suggest you read what isol(ate)cpus does and why it is used.
Short answer NO
The reason you are getting 13K max jitter, is because they are NOT spread across 2 core caches.
Please Log in or Create an account to join the conversation.
I know that isolcpus prevents the scheduler from using the isolated CPUs.
But wouldn't it make sense to run the realtime part (and only that) of linuxcnc on exactly that isolated CPUs?
Please Log in or Create an account to join the conversation.
ArcEye: such a NO asks for some experimenting...
I just tried rescheduling single tasks that are spanwed when LinuxCNC is started.
The command:
taskset -p 1 <PID of "milltask">
reduced my latency to under 7000 from 13000
Please Log in or Create an account to join the conversation.
But wouldn't it make sense to run the realtime part (and only that) of linuxcnc on exactly that isolated CPUs?
I _think_ that is actually what happens. Do you see the realtime task running on the non-isolated CPU?
As far as I recall "top" does not see the isolated cores.
[Edit]
Yes, RTAI knows how to use the isolated CPUs:
github.com/ShabbyX/RTAI/blob/master/README.ISOLCPUS
Please Log in or Create an account to join the conversation.
I expected such a behaviour. But htop Shows that all tasks are on CPU 0. In htop you can show the "Processor". According to htop every Task is on CPU 0.
Using taskset you can move single tasks to CPU 1, this is then also reflected in htop (and on my system reduces latency, this is reproducible. But I will perform more tests).
Please Log in or Create an account to join the conversation.
since nothing is run on the isolated CPUs at all, I suppose that LinuxCNC does not implement the instructions in section 2. of
github.com/ShabbyX/RTAI/blob/master/README.ISOLCPUS
2. IsolCpuMask in RTAI
Then what you have to do on the RTAI side is to load the core RTAI HAL module
using something like: "insmod rtai_hal.ko IsolCpusMask=<xxx>", where <xxx>
is the mask of isolated CPUs. Please notice that Linux uses a list if isolated
CPUs while RTAI requires the corresponding mask (I'm lazy and let you do it).
Is there any way to add the IsolCpusMark=XXX to the loading of the rtai_hal.ko?
Thanks
DomCa
Please Log in or Create an account to join the conversation.
you don't have to use isolcpus=x for the past few years.
Use this tree and RTAI will work with Linuxcnc:
github.com/NTULINUX/RTAI
Please Log in or Create an account to join the conversation.
thank you for pointing out the RTAI tree. I will test it as soon as possible.
With the standard install from the live CD all tasks (non-realtime and real-time) are scheduled on the non-isolated CPU, at least on my system.
Should the Live-CD be modified to include the NTULINUX tree?
Thanks
DomCa
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.