Howto schedule realtime tasks to CPU1 when isolcpus=1

More
9 years 9 months ago #86540 by DomCa
Hi all,

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.

More
9 years 9 months ago #86542 by ArcEye

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.

More
9 years 9 months ago #86546 by DomCa
Hi!

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.

More
9 years 9 months ago - 9 years 9 months ago #86548 by DomCa
Hi again,


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
Last edit: 9 years 9 months ago by DomCa.

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

More
9 years 9 months ago - 9 years 9 months ago #86608 by andypugh

DomCa wrote: 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
Last edit: 9 years 9 months ago by andypugh.

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

More
9 years 9 months ago #86615 by DomCa
Hi Andy,

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.

Time to create page: 0.151 seconds
Powered by Kunena Forum