If I have a CPU with 4 Cores ( for example, a Intel I5 ) and a I need to keep a process running exclusively in one theses Cores without being interrupted by the Linux Scheduler, even for a few milliseconds.
What I need to do ?
To complement this question, I have made a research, so I have a theory.
- Set the process CPU affinity to use exclusive the core I want. And set all the other processes to avoid these core.
- Set the Linux Scheduler to use the FIFO policy for the process, this means the process will not be stopped at release the CPU.
- Set all others process has Idle to avoid competition with the FIFO policy.
- Set isolcpus kernel option to avoid the kernel to use these CPU Core.
I not sure even if it’s possible to avoid the process to being stopped, because if I understand the Linux Scheduler, they are designed to hang up the process to avoid them to monopolize the CPU core.
This question it’s important, because in some research and scientific applications It’s need to run a virtual machine encapsulating a real-time application, so if the Linux stop the virtual machine to check the process list or to release the CPU core for another process, the application will be stopped too.