Normally the Linux scheduler chooses on which CPU core a process should be executed.
However, the various processes of Linux can also be pinned to one CPU core and all realtime processes to another core. This can reduce the jitter of real-time processes.
Add the following kernel parameter:
isolcpus=1
This will pin all Linux processes to CPU core 1.
To pin the processes to core 0 and core 1 use:
isolcpus=0,1
To pin a certain process to CPU core 1 use:
taskset 0x2 <rt-process>
Hint: This will pin the process to core 1, not core 2, see Bitmask further down.
The argument of taskset
is a bitmask of all cpu cores, which can be used for this process.
PID_SCRIPT=$$ taskset 0x2 $PID_SCRIPT
This will pin the process of the script and all of its child processes to CPU 1. Every program and application which is startet after this lines will run CPU 1.