A question about scheduling in Linux:
- I have several processes scheduled with CFS and one process "
A
" that is running withReal-Time (RT)
(SCHED_FIFO) scheduling - all process are bind to one specific CPU core. - The process "
A
" is running on RT (SCHED_FIFO) because it should never be preempted for the other CFS processes. - Instead, process "
A
" will release the CPU voluntarily when it decides, and let the other processes (scheduled with CFS) to utilize the CPU.
Now the question:
- How can process "
A
" release the CPU and let the other CFS processes that are ready to run, to take the CPU? - If "A" changes its policy to CFS (SCHED_OTHER), then the Linux scheduler will potentially let it also run.
- Also if "
A
" changes its policy to IDLE, still the scheduler may let it run.
I want process "A
" to get the CPU back when:
- There are no other CFS processes that are ready to run, OR a
predefined time (
e.g. 10ms
) is passed - whichever happens first. - The second condition can be achieved by another process (running on
ther CPU core) that will change "
A
" policy back to RT.
Any ideas on how this can be achieved?
More specifically, how to guarantee that only the other ready CFS processes will run, and not "
A
", until one of the mentioned conditions is met?
Thanks!