Repository navigation
Conversation
|
@rmu75 Can you run |
|
/etc/network/interfaces should not be used when using networkmanager, which is the default. I have seen many problems related to 2 configurations fighting over a network interface. It should be possible to archive the same with nmcli. |
Then you should also update the method discussed in the docs for the hm2_eth driver to set a fixed IP address. Also PREEMPT_RT is misspelt in docs and comments as PREEM_RT I will review the script as I've done a lot in those space. |
|
Thanks for the hints. This PR is still WIP but i decided to open it allready to collect some inputs. My preffered solution for network manager until now was just to uninstall it... :-D I need to investigate. Older versions just ignored static interface configs but i havn't had issues since some time. Having to assign the used CPU manually for network and then hope rtapi_app uses the same will sometimes create issues. |
|
Additional optimisations to consider My standard grub command before adding customized options You may not like to set mitigations due to supposed security risks.... |
but you need networkmanager so the user can configure wifi if used for general network. You could also consider sensing network Manufacturer and report if Realtek is used and if R8168-dkms or R8125-dkms drivers are not installed but you'd need to check the list of nics in the Debian repos for those drivers... (I just install them in the ISO by default) |
I have to postpone testing until I can get a newer kernel running, the rt preempt debian kernel 6.12.95+deb12 is extremely unstable on the alder lake fujitsu laptop (freezes within a minute after reboot). |
|
@rodw-au I use You might have to set NetworkManager is not really needed, you can do all using Just checked: Due to the network config script needs root, the solution for NetworkManager only would be dispatchers scripts. But this looks cumbersome: A systemd start script will not work, due to the IRQ kernel threads appear only after ifup and disappear after ifdown. With proper interrupt assignment and priorities, I don't need r8168-dkms anymore. It works also well with the r8169 driver, at least on my PC. Right now, there are several variants of the command line, automatically set based on sysfs information. Tested so far: 22 core with SMT on (Tested, you can isolate the SMT sibling, leave SMT on and it works quite well): 4 core which does not have SMT: |
|
apparently nm ignores interfaces in that file: |
do you have a source/reason for this? |
For a long time, rtapi_app run always on the last core, the isolation detection was broken. It was fixed in: #3903 (46c14f9) You can check this, PSR is the CPU: Isolated CPU 21, master: On 2.9, it runs on CPU 43 which is just bad: I wondered why I can only isolate the last CPU and everything else does not work. So I investigated and fixed it... |
|
Sorry, I don't have a source. just using last core came up every time I dug into PREEMPT_RT. I was really referring to PREEMPT_RT on AMD64 architecture. There are exceptions like the big.LITTLE architecture on ARM. I could never get good enough performance from my Odroid N2+ with its A73/A53 CPU. In this case, last core puts you on the slower A53 so you need to use a A73 core. I considered getting Xenomai running on it but there was no support for Xenomai on that architecture at that time. The PR referred to appears to be for Xenomai support so in my mind not really relevant to PREEMPT_RT I've always worked with. The Realtek DKMS drivers (R8168-dkms, R8125-dkms) were released with Bookworm. The real reason stems from the refusal to include vendor code in the kernel and they managed to get support with the FOSS R8169 driver. My understanding is that the DKMS drivers are building the Realtek vendor code which we don't have to download and build out of tree anymore (because DKMS does it for us). Unless you are an ardent FOSS supporter (I'm not, I just want a machine that works), I would strongly recommend using the DKMS drivers. The Realtek NIC's have enough issues in a RT environment without adding to them. I don't have a source, but its been said the Realtek drivers use 30% more memory than an Intel driver so they need all the help they can get. Wherever possible, follow Beckhoffs lead and avoid Realtek and find a PC with an Intel NIC for RT networked applications (eg Mesa and Ethercat) I don't think the LinuxCNC community understands that the limiting issue now is network latency not system latency measured by latency-histogram. A standard network stack is adequate for our needs if properly tuned. Linux now supports TSN (time sensitive networking). This requires support in the NIC which is not a major expense but it also needs a matching NIC at the other end (eg the Mesa FGPA or the Ethercat slave). Ethercat does support TSN but I doubt the Ethercat slaves in use for CNC and Mesa FGPA's will ever support it. |
This PR is mainly for PREEMPT_RT. But of course, I also add Xenomai support due to I use this most of the time. But I test everything also for PREEMPT_RT. Right now, PREEMPT_RT on AMD64 but there is no reason to not extend it to other platforms. I have a PI5 lying around waiting to be tested. But this will most probably be a second PR, so this PR is not a never ending project.
This should go to the docs, i will add it. And possibly detection & warning in the scripts.
Indeed, as long as you don't use the good old parallel port anymore, network is a big contributor to latency. However, if you don't configure the kernel correctly, network latency increases quite a lot due to the network stack is interrupted by other tasks. |
|
That looks disappointing for an i5 but normally I thought they were a 4 core PC. Will you use it with a parallel port? If not add --nobase --sbins 1000 --show as parameters. What PC is it? |
|
Hmm, this looks to me like you are not using a dedicated GPU? I never had success with intel IGPU's. The only thing that really works are dedicated AMD gpu's. Success so far with an RX460 and an RX 5500 XT. Nvidia is crap a well. I did not test integrated AMD gpu's yet but do they all share the host memory, I don't expect anything better. Which load are you running? A sign of a GPU issue is that if you only use stressng and don't touch your mouse, all is fine. As soon as you start glxgears, kicking around, starting firefox or similar, you see spikes. Anyway, as long as you are using an FPGA card over Ethernet, it should still work well enough. |
|
This is an Dell optiplex7460aio allinone PC. If you tell not touch a mouse and no gl gears it should be much better, I will try. |
|
It actually looks fine for a Mesa card. running this test will clean it up Most All in Ones I've seen use a Realtek NIC so be sure to |
Much better is not really the case. This experiment is just to identify where the large latency comes from. At the end, you will need your mouse to operate the machine. However, if you use a Mesa, max. total latency is ~800us where it still works without errors. That means:
So you will end at ~400 us which is not great but good enough. Can you do me a favor and test the following?
Like 10 min each test should be fine. If you are patient, longer is better. So I see how well the network config scripts from this PR works on a different machine than I have. NIC_NAME is the name of the interface, you have to adjust it to your PC. 5 the CPU number from your kernel config, should be fine. You might need to adjust |
|
Another idea: i think mitigations=off should have some impact. |
I tested this some time ago, no visible change as much as I remember. Setting this should mainly decrease the CPU load while making a PC somewhat easy to hack. I will add it to the doc anyway. |
fc07aa0 to
bf703c8
Compare
bf703c8 to
86d9f4c
Compare
It should improve performance on older cpus, and is not a problem unless you are running untrusted code. I Think most Linuxcnc maschines are running older cpus, and don't run untrusted code. |

The main target of this PR is to simplify the realtime configuration of LinuxCNC
There are three parts:
scripts/realtime-config-kernel/etc/sysctl.d/50-linuxcnc-rt.confscripts/realtime-config-ethernet/etc/network/interfacesscripts/latency-ping+src/hal/components/ping.compThe CPU detection for SMT / No SMT / Big / Little turned out to be quite complex and there are probably still some bugs.
The documentation is still WIP