You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a04bfde
Browse filesBrowse the repository at this point in the historyBrowse files
LinuxCNC can run on many different hardware platforms and with many
234
-
different realtime kernels, and they all may benefit from tuning for
235
-
optimal latency.
236
-
237
-
A primary goal in tuning the system for LinuxCNC is to reserve a CPU for the exclusive use of LinuxCNC's realtime tasks, so that other tasks (both user programs and kernel threads) do not interfere with LinuxCNC's access to that CPU.
238
-
239
-
When specific tuning options are believed to be universally helpful
240
-
LinuxCNC does this tuning automatically at startup, but many tuning
241
-
options are machine-specific and cannot be done automatically. The person
242
-
installing LinuxCNC will need to experimentally determine the optimal
243
-
tuning for their system.
244
-
245
-
246
-
=== Tuning the BIOS for latency
247
-
248
-
PC BIOSes vary wildly in their latency behavior.
249
-
250
-
Tuning the BIOS is tedious because you have to reboot the computer,
251
-
make one small tweak in the BIOS, boot Linux, and run the latency test
252
-
(potentially for a long time) to see what effects your BIOS change had.
253
-
Then repeat for all the other BIOS settings you want to try.
254
-
255
-
Because BIOSes are all different and non-standard, providing a detailed
256
-
BIOS tuning guide is not practical. In general, some things to try
257
-
tuning in the BIOS are:
258
-
259
-
* Disable ACPI, APM, and any other power-saving features. This includes
260
-
anything related to power saving, suspending, CPU sleep states, CPU
261
-
frequency scaling, etc.
262
-
263
-
* Disable CPU "turbo" mode.
264
-
265
-
* Disable CPU hyperthreading.
266
-
267
-
* Disable (or otherwise control) System Management Interrupt (SMI).
268
-
269
-
* Disable any hardware you do not intend to use.
270
-
271
-
272
-
[[sec:latency-governor]]
273
-
=== CPU frequency governor
274
-
275
-
Frequency scaling lets the CPU lower its clock speed to save power, which adds
276
-
latency while the CPU ramps back up to service a realtime thread. For the best
277
-
latency, set the governor to `performance` on every CPU:
278
-
279
-
----
280
-
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
281
-
----
282
-
283
-
This setting does not survive a reboot. To make it permanent, apply it at boot
284
-
with a small systemd service, or with a CPU frequency management tool such as
285
-
`cpupower` (Debian/Ubuntu package `linux-cpupower`) or `tuned`.
286
-
287
-
288
-
[[sec:tuning-preempt-rt]]
289
-
=== Tuning Preempt-RT for latency
290
-
291
-
The Preempt-RT kernel may benefit from tuning in order to provide the
292
-
best latency for LinuxCNC. Tuning may be done via the kernel command
293
-
line, sysctl, and via files in `/proc` and `/sys`.
0 commit comments