2.8.2/Buster: should I use isolcpus=1 or cpuset
- tatel
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 16
26 Jun 2022 19:22 #245949
by tatel
2.8.2/Buster: should I use isolcpus=1 or cpuset was created by tatel
Hi all
After some quite happy years with 2.7.x, I'm testing some refurbished machines with 2.8.2. IIRC, I have read quite a few times that isolcpus=1 was deprecated and that last linuxcnc versions use cpuset. So I'm trying to use cpuset, yet I'm getting better latencies with isolcpus=
Could you guys give me any pointer about how to use cpuset or should I continue to use isolcpus=?
Cheers
After some quite happy years with 2.7.x, I'm testing some refurbished machines with 2.8.2. IIRC, I have read quite a few times that isolcpus=1 was deprecated and that last linuxcnc versions use cpuset. So I'm trying to use cpuset, yet I'm getting better latencies with isolcpus=
Could you guys give me any pointer about how to use cpuset or should I continue to use isolcpus=?
Cheers
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19461
- Thank you received: 6529
26 Jun 2022 21:34 #245958
by tommylight
Replied by tommylight on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
Use whatever works best for you, no harm in using either.
Although i have not seen cpuset mentioned here on this forum.
Depreciation of isolcpus refers to new PC's with more cores and better processor load balancing, so no need for it.
Although i have not seen cpuset mentioned here on this forum.
Depreciation of isolcpus refers to new PC's with more cores and better processor load balancing, so no need for it.
The following user(s) said Thank You: tatel
Please Log in or Create an account to join the conversation.
- tatel
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 16
28 Jun 2022 13:49 - 28 Jun 2022 14:03 #246077
by tatel
Replied by tatel on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
It turns out that the word "deprecated" is in kernel parameters doc for 4.19
www.kernel.org/doc/html/v4.19/admin-guid...rnel-parameters.html
You are very probably right about cpuset not mentioned here, but I got it indirectly from this helpful andypugh's answer
So, going to SabbyX's github , one gets info about both isolcpu's and cpuset
Yet some more clarity would be quite helpful, he talks about insmod:
...to see what the latency could really be using isolcpus/make sure linuxcnc isn't getting disturbed by other system tasks
In the cpuset initscript example, again the code seems quite clear to me, however having also the commands to start each part of linuxcnc in each cpuset would be also helpful
I'm going to test, among others, a 4-core computer and, since this is a more powerful machine, isolcpus is deprecated by kernel developers so probably missing in the future, and cpuset is said to be "better than isolcpus", I'm trying cpuset (at this moment in an Athlon X2 dual core machine). Yet I'm getting better results with isolcpus, so I guess I'm getting something wrong about launching linuxcnc via cpuset (and probably so even via isolcpus) .
So my questions are about:
1- How to launch linuxcnc to be sure it gets one or more CPUs exclusively for himself.
2- In the example, SabbyX seems to put the GUI (axis, whatever) in the second core, which wouldn't be a real-time one. ¿Am I getting it right? What command should I use to do that?
(edited twice, first for typos then for tag mess)
Cheers
www.kernel.org/doc/html/v4.19/admin-guid...rnel-parameters.html
isolcpus= [KNL,SMP,ISOL] Isolate a given set of CPUs from disturbance.
[Deprecated - use cpusets instead]
Format: [flag-list,]<cpu-list>
You are very probably right about cpuset not mentioned here, but I got it indirectly from this helpful andypugh's answer
So, going to SabbyX's github , one gets info about both isolcpu's and cpuset
Yet some more clarity would be quite helpful, he talks about insmod:
Then what you have to do on the RTAI side is to load the core RTAI HAL moduleusing something like: "insmod rtai_hal.ko IsolCpusMask=<xxx>", where <xxx> is the mask of isolated CPUs[/code}
However that seems to just load the module into the kernel, but some more info about how to start axis GUI, etc, would be helpful. I.E, when testing latency, I do...
[code]taskset 1 latency-histogram{/code]
...or even...
[code]taskset 1 linuxcnc
...to see what the latency could really be using isolcpus/make sure linuxcnc isn't getting disturbed by other system tasks
In the cpuset initscript example, again the code seems quite clear to me, however having also the commands to start each part of linuxcnc in each cpuset would be also helpful
I'm going to test, among others, a 4-core computer and, since this is a more powerful machine, isolcpus is deprecated by kernel developers so probably missing in the future, and cpuset is said to be "better than isolcpus", I'm trying cpuset (at this moment in an Athlon X2 dual core machine). Yet I'm getting better results with isolcpus, so I guess I'm getting something wrong about launching linuxcnc via cpuset (and probably so even via isolcpus) .
So my questions are about:
1- How to launch linuxcnc to be sure it gets one or more CPUs exclusively for himself.
2- In the example, SabbyX seems to put the GUI (axis, whatever) in the second core, which wouldn't be a real-time one. ¿Am I getting it right? What command should I use to do that?
(edited twice, first for typos then for tag mess)
Cheers
Last edit: 28 Jun 2022 14:03 by tatel. Reason: typo, tags got messed
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23162
- Thank you received: 4860
29 Jun 2022 22:22 #246226
by andypugh
Replied by andypugh on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
I would be interested to see what you conclude. I don't know the answers.
The only way to sort out the tags after editing is to switch to the full editor and click the "source" button, so that you can see and edit the tags.
It's a terrible mess, this current editor.
The only way to sort out the tags after editing is to switch to the full editor and click the "source" button, so that you can see and edit the tags.
It's a terrible mess, this current editor.
Please Log in or Create an account to join the conversation.
- tatel
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 16
30 Jun 2022 16:37 #246287
by tatel
Replied by tatel on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
Well, I'm fighting my way through it right now. Should I be able to get somewhere I'll report about it. Would be easier if anyone could confirm if launching linuxcnc via taskset is OK, etc. In absence of confirmation/instrucyions, I'll do it my way...
About editing message tags in source: nope, I tried it some three times before giving up. It got messed anyway
About editing message tags in source: nope, I tried it some three times before giving up. It got messed anyway
Please Log in or Create an account to join the conversation.
- robertspark
- Offline
- Platinum Member
Less
More
- Posts: 915
- Thank you received: 216
30 Jun 2022 18:01 #246290
by robertspark
Replied by robertspark on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
I use isolcpus
I generally run quad cores
so the CPUs numbering starts from "0" zero to 3 in my case.
I tend to use 1,2,3
but I test all configs on latency
set / change
reboot
retest for about 5 mins
set/change
repeat
write the numbers on a notepad and use the lowest number then do a long 2 hour test.
I generally run quad cores
so the CPUs numbering starts from "0" zero to 3 in my case.
I tend to use 1,2,3
but I test all configs on latency
set / change
reboot
retest for about 5 mins
set/change
repeat
write the numbers on a notepad and use the lowest number then do a long 2 hour test.
Please Log in or Create an account to join the conversation.
- tatel
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 16
04 Jul 2022 10:00 #246569
by tatel
Replied by tatel on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
Well, I have to give cpuset a try yet, but I have been comparing 2.8.2-rt vs 2.8.2-rtpreempt and Debian vs Devuan. I guess cpuset will have to wait until next weekend. I have been reading linuxcnc script so I have now a guess on how the different parts of it could be launched.
Test computer is an HPCompaq 5850 MT, Athlon 64 X" dualcore, with an almost useless BIOS.
My boot line has nowatchdog usbcore.nousb acpi_irq_nobalance isolcpus=1 idle=poll in all cases. The usbcore.nousb part for sure seems to be useless after you work your smp-affinity but I maintained it just because the first test had it. nowatchdog has quite good effects once system's load gets up. I need idle=poll because this computer BIOS doesn't allow you to set anything related to C-states.
Devuan 3 Beowulf is Debian Buster without systemd/pulseaudio. I hate systemd's guts and pulseaudio is his closest friend. What I did on Devuan is just installing the basic system utilities, then a very basic Xorg server, with just WindowMaker window manager and xterm, then installed linuxcnc kernel and application.
Both Devuan Beowulf and Debian Buster let me down when doing update-grub if there was more than a system installed, I don't know where the grub.cfgs are gone but I know for sure that I needed to edit the boot line at boot time in grub itself
With 2.8.2-rtpreempt on both Debian and Devuan, I noticed that, even with isolcpus=1 on the boot line, my NIC (driver tg3, and probably others like USB) was sending IRQs to cpu 1. So latency tests were bad, well over 100 usec, reaching even 600-800 usec latency in just a few minutes. I needed to put at work an smp-affinity script along the lines of this post . I just stripped the ubuntu parts and placed it on /etc/rc.local on Devuan so it is executed at boot. On Debian, where systemd has to control the rackets, that's just bad practice. So I just execute it myself before launching latency-histogram with "taskset 1 latency-histogram". Then results are quite good enough to do software stepping, just a little over 25 usec on Debian and a little under 20 usec on Devuan.
2.8.2-rt worked wonders for me. No need to do nothing once you have isolcpus=1 on your grub boot line. Without it, it hangs wonderfully. Latency results are almost the same thing on Debian and Devuan, about 5 usec. I'm still dazzled. I noticed than the system load and memory consumption were better on the light weight Devuan system, let's say about half the RAM and 40% less load.
Debian Buster 2.8.2-rtpreempt with no smp-affinity work
Debian Buster 2.8.2-rtpreempt with retouched smp_affinity
Debian Buster 2.8.2-rt
Devuan Beowulf 2.8.2-rtpreempt
Devuan Beowulf 2.8.2-rt
Test computer is an HPCompaq 5850 MT, Athlon 64 X" dualcore, with an almost useless BIOS.
My boot line has nowatchdog usbcore.nousb acpi_irq_nobalance isolcpus=1 idle=poll in all cases. The usbcore.nousb part for sure seems to be useless after you work your smp-affinity but I maintained it just because the first test had it. nowatchdog has quite good effects once system's load gets up. I need idle=poll because this computer BIOS doesn't allow you to set anything related to C-states.
Devuan 3 Beowulf is Debian Buster without systemd/pulseaudio. I hate systemd's guts and pulseaudio is his closest friend. What I did on Devuan is just installing the basic system utilities, then a very basic Xorg server, with just WindowMaker window manager and xterm, then installed linuxcnc kernel and application.
Both Devuan Beowulf and Debian Buster let me down when doing update-grub if there was more than a system installed, I don't know where the grub.cfgs are gone but I know for sure that I needed to edit the boot line at boot time in grub itself
With 2.8.2-rtpreempt on both Debian and Devuan, I noticed that, even with isolcpus=1 on the boot line, my NIC (driver tg3, and probably others like USB) was sending IRQs to cpu 1. So latency tests were bad, well over 100 usec, reaching even 600-800 usec latency in just a few minutes. I needed to put at work an smp-affinity script along the lines of this post . I just stripped the ubuntu parts and placed it on /etc/rc.local on Devuan so it is executed at boot. On Debian, where systemd has to control the rackets, that's just bad practice. So I just execute it myself before launching latency-histogram with "taskset 1 latency-histogram". Then results are quite good enough to do software stepping, just a little over 25 usec on Debian and a little under 20 usec on Devuan.
2.8.2-rt worked wonders for me. No need to do nothing once you have isolcpus=1 on your grub boot line. Without it, it hangs wonderfully. Latency results are almost the same thing on Debian and Devuan, about 5 usec. I'm still dazzled. I noticed than the system load and memory consumption were better on the light weight Devuan system, let's say about half the RAM and 40% less load.
Debian Buster 2.8.2-rtpreempt with no smp-affinity work
Debian Buster 2.8.2-rtpreempt with retouched smp_affinity
Debian Buster 2.8.2-rt
Devuan Beowulf 2.8.2-rtpreempt
Devuan Beowulf 2.8.2-rt
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23162
- Thank you received: 4860
04 Jul 2022 23:40 #246611
by andypugh
The answer seems to be to make the changes, then boot into the first system that you installed, run update-grub there and then go back to the other system, at which point the changes have probably "stuck"
Replied by andypugh on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
I haver a triple-boot system, and have seen this problem.Both Devuan Beowulf and Debian Buster let me down when doing update-grub if there was more than a system installed, I don't know where the grub.cfgs are gone but I know for sure that I needed to edit the boot line at boot time in grub itself
The answer seems to be to make the changes, then boot into the first system that you installed, run update-grub there and then go back to the other system, at which point the changes have probably "stuck"
Please Log in or Create an account to join the conversation.
- tatel
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 16
10 Jul 2022 09:02 #246999
by tatel
Replied by tatel on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
Well, cpuset didn't gave any great results. So far, I got better latencies by using isolcpus=
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- DanRoscigno
- Offline
- New Member
Less
More
- Posts: 5
- Thank you received: 0
16 Jun 2023 21:28 #273718
by DanRoscigno
Replied by DanRoscigno on topic 2.8.2/Buster: should I use isolcpus=1 or cpuset
Hi tatel, I just built my system. I am running Debian 12 with no window manager, just twm and an xterm started with xinit. Without isolcpus and the default BIOS settings I was seeing spikes in jitter to 175.
I fixed the BIOS settings to turn off power management and it dropped down to about 25, but still had an occasional spike.
Then I set isolcpus to 2,3 (quad core machine) and ran latency-histogram again. Rock steady at 5 jitter.
Finally my question: I looked at ps and see that both latency-histogram and glxgears (I ran 6 copies of glxgears) are running on CPU 0. I don't recognize anything on CPU 2 or 3 as being related to latency-histogram. Should I be using taskset to make latency-histogram run on the isolated CPUs? And when I actually run linuxcnc, should I be using taskset to run that on the isolated CPUs?
Thanks,
Dan
I fixed the BIOS settings to turn off power management and it dropped down to about 25, but still had an occasional spike.
Then I set isolcpus to 2,3 (quad core machine) and ran latency-histogram again. Rock steady at 5 jitter.
Finally my question: I looked at ps and see that both latency-histogram and glxgears (I ran 6 copies of glxgears) are running on CPU 0. I don't recognize anything on CPU 2 or 3 as being related to latency-histogram. Should I be using taskset to make latency-histogram run on the isolated CPUs? And when I actually run linuxcnc, should I be using taskset to run that on the isolated CPUs?
Thanks,
Dan
Please Log in or Create an account to join the conversation.
Time to create page: 0.071 seconds